I have a custom page types (Content Only) for Locations. Then I have a landing page (/company/locations/) with repeater to list all locations and their details. Things work well so far. Now, after adding the smart search, I notice that if I search a location name like 'san francisco', the landing page didn't show up in search result, but the content-only page showed with a URL like this /company/locations/san-francisco. The thing is, this URL results in 404 since that page doesn't really exist. What should I do? Should I re-create the page type and change it to a regular page instead of content only before it's too late? Or is there a way to make individual location url (/company/locations/san-francisco) work - considering we can't specify a page template to go with content only page type? Thanks!
MichelleMichelle
Adding page aliases. You can add more URLs to pages through page aliases. Aliases do not change how the system generates the main URL of a page, they only make the given page available under other URLs. To create page aliases: Open the Pages application. Select the page in the content tree. Open the Properties - URLs tab. Click Add new alias in the Page aliases section. You can fill in the following properties for each alias.
2 Answers
If you don't want that URL to show then simply exclude those page types from that search index. But if you want them to specifically show, then create a detail or selected transformation for that
/company/locations
repeater to display when someone navigates to it from the search. This will also be good for google and other search indexes if you plan to have specifics for each location.Brenden KehrenBrenden Kehren
There are multiple types of Search indexes in Kentico.
'Pages' scans the data of a document, such as any webparts+properties, editable text, form data, etc. They do NOT scan the rendering on the page though, it doesn't catch any Repeaters (what you're using).
'Page Crawler' will literally load the page, and scan all the content in the page. This will catch Repeaters and dynamic content like that.
Knowing this, you have a couple options.
- Use Pages, then Modify the Smart Search Result and add some transformation logic to say something like the below
- Use Page Crawler, tell it specifically to only index the /company/locations.
- Use Page Crawler, and also a custom smart search indexer so you can exclude the header/footer or other areas out of the content (it's a bit more advanced)
Trevor FTrevor F