Problems, need help? Have a tip or advice? Post it here.
12 posts Page 1 of 2
Hi
I am attempting to build a site using Couch, and I just enabled PrettyURLS and found an issue.

So, currently, when I visit a page on my site that's in a menu hierarchy, I end up with this
site.com/clonabletemplatename/page-at-level-0-of-heirarchy/pageivisited
like this:
site.com/services/our-services/widgetbuilder/

And when I visit site.com/services/ I just get a blank page. Ideally I'd like to not show /services/ and just have site.com/our-services/widgetbuilder/ as our-services is a page built by me.

Is this at all possible, and have I made any sense? ;p

[edit] I guess my question is, is it possible to disable/alter the list view functionality so that it becomes the page at the top of a given hierarchy? [edit]
Hi,

'site.com/services' would be the list-view. When someone accesses the list-view directly you want him to automatically reach 'site.com/our-services/widgetbuilder/' (a page-view).

To do so, place the following code somewhere just below (but outside) the cms:template block at the template's start -
Code: Select all
<cms:if k_is_list>
    <cms:redirect "<cms:link masterpage=k_template_name page='widgetbuilder' />" />
</cms:if>

Does this help?
That's sort of what I'm looking for, but I'd prefer to just remove 'services' from the url completely, so it becomes site.com/our-services/page - is this possible?

Thanks btw!
just remove 'services' from the url completely
I take it you mean from the URL as displayed in the menu, right?

If so, can you let us know how you have created the menu? Using cms:menu or any other way?
Sorry, I didn't do a particularly good job of explaining the issue, would you mind if I pm'd you so I can be a little more specific? I'll post the resolution here afterwards for others of course!
Please go ahead.
Here's what I plan on posting:

Right, the site I was vaguely discussing is http://[removed]/ - if you hover over Services and then click Widget creation for example, the URL you get sent to is http://[removed]/services/our-services/widget-creation/

This is okay, but if I try to visit services(the list view page I guess) the page is just blank, and I can't figure out how to edit it from couch.

Attached is a screenshot of the current hierarchy, the page at the top is our-treatments ie http://[removed]/services/our-services/

[removed screenshot]

What would I need to do to just remove /services/ from the url so that the url would become http://[removed]/our-services/widget-creation/ or even http://[removed]/services/widget-creation/ if that's easier?

I considered modifying the generated .htaccess rules but they'd obviously become invalidated when I run gen_htaccess.php again.

Thanks again for your help, hope I've made more sense this time.
Hi,

From what I can make out you are using 'services.php' template to create the menu.

What seems to be bothering you is the inclusion of the template name in the URL.

The only way of removing the template name from the URL is by using 'index.php' as template.

So, for example, if instead of 'services.php' you used 'index.php', the URLs would become
http://www.yoursite.com/our-services/widget-creation/
- no 'index' up there.

One issue you'd have would be this URL -
http://www.yoursite.com/
This is where you must be using your current 'index.php'.

This can be rectified by, say, using a template named 'home.php' instead of the index.php you are using currently.

http://www.yoursite.com would be the home_view of our new nested index.php. We can make it show the contents of home.php as follows
Code: Select all
<cms:if k_is_home>
   <cms:masquerade "<cms:link masterpage='home.php' />" />
</cms:if>

or
Code: Select all
<cms:if k_is_home>
   <cms:pages masterpage='home.php'>
     .. show editable regions of home page here e.g. ..
     <cms:show content />
   </cms:pages>
</cms:if>

OK, so if you agree that using index.php as the nested-pages template is the way to go, question is how to switch over from the current
'services.php' to 'index.php' and the current 'index.php' to 'home.php'?

You'll have to manipulate the database directly (using phpMyAdmin etc.) for that. Find the records for the two templates in 'couch_templates' table and change their names. Next rename the physical files on the server.

Make sure to take a backup if possible.

Hope this helps.
Quick Q regarding this, is it possible for the now home.php to not direct to site.com/home/, but instead just be site.com/?
I had mentioned in my original post a way to show the contents of home.php in the home-view of index.php (i.e. site.com/) -
Code: Select all
<cms:if k_is_home>
   <cms:masquerade "<cms:link masterpage='home.php' />" />
</cms:if>

Have you tried using that? Does it work (i.e. shows contents of site.com/home.php on site.com/)?
12 posts Page 1 of 2