Content Type without alias in cmsms 2

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
rooon
Forum Members
Forum Members
Posts: 113
Joined: Mon Dec 05, 2011 4:40 pm
Location: Nederland

Content Type without alias in cmsms 2

Post 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
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: Content Type without alias in cmsms 2

Post 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
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
rooon
Forum Members
Forum Members
Posts: 113
Joined: Mon Dec 05, 2011 4:40 pm
Location: Nederland

Re: Content Type without alias in cmsms 2

Post 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?
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: Content Type without alias in cmsms 2

Post by Rolf »

Uhm, in combination with a correct set canonical url it could work. Cant over see all factors of course...
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
rooon
Forum Members
Forum Members
Posts: 113
Joined: Mon Dec 05, 2011 4:40 pm
Location: Nederland

Re: Content Type without alias in cmsms 2

Post 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 ;)
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Content Type without alias in cmsms 2

Post 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.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: Content Type without alias in cmsms 2

Post 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
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1627
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: Content Type without alias in cmsms 2

Post 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.
Not getting the answer you need? CMSMS support options
rooon
Forum Members
Forum Members
Posts: 113
Joined: Mon Dec 05, 2011 4:40 pm
Location: Nederland

Re: Content Type without alias in cmsms 2

Post 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
rooon
Forum Members
Forum Members
Posts: 113
Joined: Mon Dec 05, 2011 4:40 pm
Location: Nederland

Re: Content Type without alias in cmsms 2

Post 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.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Content Type without alias in cmsms 2

Post 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.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Content Type without alias in cmsms 2

Post 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.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
rooon
Forum Members
Forum Members
Posts: 113
Joined: Mon Dec 05, 2011 4:40 pm
Location: Nederland

Re: Content Type without alias in cmsms 2

Post 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.
Post Reply

Return to “CMSMS Core”