Page 1 of 1
Content Type without alias in cmsms 2
Posted: Wed Jul 04, 2018 2:45 pm
by rooon
Hi there,
I'm using Bootstrap 4 in new websites. It seems that it is not possible to make a seo friendly menu in CMSMS for Bootstrap 3 and 4. Example content with alias (= Content Type):
Code: Select all
content
- content-1
section-header
- content-2
internal-page-link (destination: content-3)
- content-3
In all cases CMSMS adds the parent alias in the url.
In Bootstrap, a parent is not used as content page and therefore unwanted in the url.
Also I tried to solve this in the css with a split button (leftside the link and rightside the dropdown button) but in many articles this is not advised.
My question:
How to make a new Content Type like the Section Header but without the alias and without showing up in the url. Or is it possible through the Navigator template by changing the Smarty?
Thanx in advance for any help.
Ronald
Re: Content Type without alias in cmsms 2
Posted: Wed Jul 04, 2018 3:40 pm
by Rolf
My question:
How to make a new Content Type like the Section Header but without the alias and without showing up in the url.
This is "by default" not possible. It is the way CMSMS is build... All content items have an alias.
But to do let it work you can use slug or page urls, you have to do that manually though! You find it in the Navigation tab of the page.
grtz. Rolf
Re: Content Type without alias in cmsms 2
Posted: Wed Jul 04, 2018 4:56 pm
by rooon
Thanx Rolf for your reply.
Related to the editor / administrator separation, a page url is unfortunately not a nice solution for the editor. If he forgets this field and adds it later then the page is indexed twice by Google with different url's and will be downgraded for having duplicates.
Another idea:
All section headers (parents) do have an alias "cidNN" where NN is the content ID.
In the Navigator template:
Code: Select all
<a href="{$node->url|regex_replace:'/cid[0-9]+\//i':''}">
After this, the alias of the section header (parent) is not shown in the html of the menu.
Do you think this idea can work?
Or did I forget something, for example in .htaccess?
Re: Content Type without alias in cmsms 2
Posted: Wed Jul 04, 2018 5:01 pm
by Rolf
Uhm, in combination with a correct set canonical url it could work. Cant over see all factors of course...
Re: Content Type without alias in cmsms 2
Posted: Wed Jul 04, 2018 5:51 pm
by rooon
Again, thanx for the reply. Canonical, good point. I will put it in global in the CorePage template. It's tricky when using this in 3rd party modules. This solution is also not the easiest and best one.
Being creative with what we have

Re: Content Type without alias in cmsms 2
Posted: Wed Jul 04, 2018 6:17 pm
by calguy1000
I'm using Bootstrap 4 in new websites. It seems that it is not possible to make a seo friendly menu in CMSMS for Bootstrap 3 and 4. Example content with alias (= Content Type):
Sure it is. I've done it in boostrap(3) a few times. It is just a matter of creating the navigation the way you want it. If you don't want an href attribute for section headers, then your template should not create one. Most of the time, I use labels for section headers. Then it's not a link.
In all cases CMSMS adds the parent alias in the url.
Yes, unless you specify a page_url/slug for each page, then the URL for a content page is built from the heirarchy of aliases. There are config settings to help specifying the page_url/slug when creating new content pages.
In Bootstrap, a parent is not used as content page and therefore unwanted in the url.
Bootstrap is for appearance and styling, it cares little about the structure of URL's in the HTML. and it has nothing to do with whether your site is SEO friendly or not.
Re: Content Type without alias in cmsms 2
Posted: Wed Jul 04, 2018 6:31 pm
by Rolf
rooon wrote:Again, thanx for the reply. Canonical, good point. I will put it in global in the CorePage template. It's tricky when using this in 3rd party modules. This solution is also not the easiest and best one.
Being creative with what we have

Isn't that hard at all! I described it here:
https://cmscanbesimple.org/blog/base-cm ... d-metatags
Re: Content Type without alias in cmsms 2
Posted: Wed Jul 04, 2018 7:49 pm
by DIGI3
Side note, it's important with any CMS (and website in general) to set up a canonical tag. When using pretty urls, there's an infinite number of entry points to any page.
E.g., a page with the alias "foobar" with the heirarchy /foo/bar/foobar
could be accessed by:
https://site.com/foobar
https://site.com/foo/bar/foobar
https://site.com/index.php?page=foobar
https://site.com/banana/foobar
https://site.com/tuesday/123/foobar
etc.
Having the canonical url set prevents any of those getting a duplicate content penalty if indexed for whatever reason.
As to your original issue, Calguy is correct, you just remove the link for that content type from the Navigator template. That's already done for section headers and dividers in the sample templates. Most frameworks have a workaround for styling when there's no <a> tag (I use Foundation, and it uses .menu-text for that situation. I'm sure Bootstrap has an equivalent, but if not it's not hard to simulate. You could even do <a href="#" onclick="event.preventDefault();">{$node->menutext}</a> for section headers if you're really stuck.
Re: Content Type without alias in cmsms 2
Posted: Wed Jul 04, 2018 7:54 pm
by rooon
Hi Calguy,
Thanx for your reply.
I think you misunderstood my post. It is not about having or not having an url in the template, my question is about an url that is pushed to level 2.
This is my question by example:
Code: Select all
/section-header/content-page
/section-header/content-page/content-page
The content-page in the first line is pushed to level 2 and in the second line to level 3. By removing the /section-header , the url is more friendly for customers and Google. This has ofcourse nothing to do with using Bootstrap or not.
Playing with the Navigator template to create the Bootstrap navbar is not a problem here, this is done before.
Thanks for the tip in the Global Settings (Auto create [flat] [required] urls). This may be helpful but seems not the solution here unless I choose for flat urls, not useful in my websites.
Bootstrap is for appearance and styling, it cares little about the structure of URL's in the HTML. and it has nothing to do with whether your site is SEO friendly or not.
Fully agree, except one thing. Websites seems to be more and more having toplevel buttons without page-href, the anchor just takes care for the dropdown menu. This is not Bootstrap related, its a trend. For this reason I posted my question here.
Thanks for your post and your great work.
Ronald
Re: Content Type without alias in cmsms 2
Posted: Wed Jul 04, 2018 8:12 pm
by rooon
Isn't that hard at all! I described it here
Thanx. Nice way to default the canonical.
Side note, it's important with any CMS (and website in general) to set up a canonical tag.
Thanx for your explanation. For Google this is essential.
Re: Content Type without alias in cmsms 2
Posted: Wed Jul 04, 2018 8:39 pm
by calguy1000
Code: Select all
/section-header/content-page
/section-header/content-page/content-page
The content-page in the first line is pushed to level 2 and in the second line to level 3. By removing the /section-header, the url is more friendly for customers and Google. This has ofcourse nothing to do with using Bootstrap or not.
You do realize that is bogus too.
a: Users don't type in links, they click them. From the user perspective, only the domain name really must be easy to type and memorable.
b: The point and the reason that the hierarchy is by default included in URL's is to make the URL more descriptive. and more SEO friendly, and to give a naturally self-describing path. Of course, if you are using bogus aliases, then it's useless and counterproductive. But google DOES NOT CARE (within reason) about the length of the URL, it cares about finding meaningful, relevant words to index.
Re: Content Type without alias in cmsms 2
Posted: Wed Jul 04, 2018 8:46 pm
by calguy1000
In fact... CMSMS really only cares about the page alias, or URL-slug or page-id.
You can create links to site.com/foo/bar/junk/whatever/some-alias or site.com/some-alias and CMSMS doesn't care. It only cares about the 'some-alias' part. Google, however, does. Google does not understand that those are the same page. Which is why setting up the canonical URL's is critical on apps where SEO ranking is important.
That's what Rolf is talking about.
Re: Content Type without alias in cmsms 2
Posted: Thu Jul 05, 2018 12:56 pm
by rooon
Everybody thanx for the info on do's and dont's, always helpful. I think that my idea (04 Jul 2018 18:56) is not recommended by the dev team to prevent issues. I'll follow the standards.