Forgive my ignorance... Just started playing w/ ModX a couple of weeks ago. I have experience w/ a commercial CMS package that I use with my real job, but want to use ModX to build my own personal sites.
PROBLEM:
So I am trying to use Friendly URLs... I am trying to have URLs like:
www.example.com/ (home page)
www.example.com/seo/
www.example.com/seo/link-development/
www.example.com/seo/keyword-analysis/
www.example.com/about-us/
www.example.com/contact-us/
Basically, I want extentionless URLs with a trailing ’/’.
In ModX manager -> Tools -> Configuration, I have selected:
Use Friendly URLs: Yes
Prefix for Friendly URLs: (blank)
Suffix for Friendly URLs: /
Use Friendly Aliases: Yes
Use Friendly Alias Path: Yes
Every page in the manager has been given an alias EXCEPT the home page... I’ve tried giving it an alias of ’/’ but the manger blanks it out when I save it.
The problems are that when I use the following Wayfinder snippet call to generate my top navigation menu:
[!Wayfinder? &startId=`1` &displayStart=`TRUE` &level=`2` &outerTpl=`myglobalnav-ul` &rowTpl=`myglobalnav-li` &hereTpl=`myglobalnav-li-active` !]
1) my home page which has an id=1 and is the parent in the manager for the /seo/, /about-us/, /contact-us/ pages is NOT showing up in the menu generated by Wayfinder AND
2) the menu generated does include the children of the home page but they get generated with URLs of the form www.example.com/1/seo/, www.example.com/1/about-us/, www.example.com/1/contact-us/.
My questions are:
1) How do I get my home page to show up in the menu as well as it’s children? and
2) How do I get rid of the /1/ in all of the URLs. I know it is because the home page doesn’t have an alias so it is using the id. If I give the home page an alias like ’home’ then the URLs are all of the form www.example.com/home/seo/, www.example.com/home/about-us/, and www.example.com/home/contact-us/.
What am I missing. How do I get rid of the /1/ in all of the paths...
Forgive me if this is the wrong place for this post. Perhaps the moderators can move it. As I said, I’m very new to ModX and this is my first post here.
Thanks in advance!
Jim
When I try that I ONLY get the home page link rendered in my navigation... None of it’s children are rendered... I even tried it with &level=`2` and &level=`3` and still only the home page is rendered.
Wierd... The home page link doesn’t have /1/ in it. It is rendered properly as www.example.com/. Yet when &startId=`1` the children are all rendered as www.example.com/1/childpage/.
Have you built all the docs under the document with id 1?
Click create new page button above the tree and create docs
under and see them appear _next to_
~1~ or all pages will be children to that doc.
Be sure menu-title field is filled in "show in menu" is ticked, and that the doc is published.
//Log in here --->
http://TryMODx.com
Yes they are all children of the home page, show in menu is ticked, and all published... Otherwise, they wouldn’t be showing up at all in the menu when startId=`1`. The pages all have a menu title which is correctly showing.
Above the "home page" you see the site name in black text. When you click the button to
create document - it creates document in root of the tree. When you make document 1 to a container
and create children (by right click) under it you are operating under document id 1, and therefor it will show up in the url.
In order to NOT have it shown you will have to create docs from root of the tree. unfold/contact doc 1 and
you see what I mean!
So the home page, about us, contact us pages all need to be defined immediately below the site... on the same level?
This may help, but it also may get a little long winded, so bear with me....
1. Move everything out from under your home page. They don’t need to be children of the home page, as for your /seo/ section, they will show up as in that folder automatically (and without /1/) if you set ’Use Friendly Alias Path’ to ’Yes’. What you do need to do is make sure all your documents that belong in /seo/ are children of your /seo/ document.
2. &startId=`0` (This will show all documents starting at root, even and including if they are in the root).
3. Unless you have a reason to only go so deep, set &level=`0` which will be unlimited depth. If you have a lot of stuff in your submenus, you can set &hideSubMenus=`TRUE` which will hide all submenus except for the active one.
4. In your tpl chunks, make sure that you remembered to include the [+wrapper+] placeholder, and that you also remembered to include the [+wrapper+] placeholder in your row item tpls; if that placeholder isn’t in your row item tpls, there is nowhere for wayfinder to put in the submenus, which may explain why you aren’t seeing them show up?
"Great spirits have always encountered violent opposition from mediocre minds." -Albert Einstein
Cool I moved them all up to the same level as the home page... and it works!
Thanks so much... I’ve been tinkering with this off and on for 2 wks trying to figure out first why the /1/ was showing up and then how to get rid of it. I really appreciate the help.