GetSimple Support Forum

Full Version: Problem with Slug/URL with same subpages
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm not able to make subpages with same slug under different parent pages.

For Example:
www.website.com/parent1/subpage/
www.website.com/parent2/subpage/ (I need this)
But Get Simple automatically changes the slug to www.website.com/parent1/subpage-1/

Please let me know how to solve this weird problem.
its not really a weird problem - and i'm not sure how we would fix it.

All pages are saved as {slug}.xml. Since you have two pages with the same slug name, then the system prevents the overwriting by appending a -1 to it.
I never came across this kinda algorithm in the CMSes I used: wp, drupal and joomla.
Please help to get out of this problem if possible or take it as a feature suggestion.
nvinanda Wrote:I never came across this kinda algorithm in the CMSes I used: wp, drupal and joomla.
Please help to get out of this problem if possible or take it as a feature suggestion.

Think of the slug as an ID. They must be unique. They are in drupal or joomla as well, but in that case they are auto-generated numbers, not text.

-Rob A>
nvinanda Wrote:wp, drupal and joomla.
These are also database driven CMSs
Thanks, but I can't use it before fixing the "-1" thing.
Would you like to suggest GetSimple alternative (without database) which doesn't append a -1 to this situation?
nvinanda Wrote:Would you like to suggest GetSimple alternative
we really aren't in the business of suggesting other CMS's around here Smile.

Sorry the -1 is enough of a hindrance to make you consider leaving GS.
In case GetSimple solves this issue, please update to this thread. I know its difficult because you need to change the whole algorithm of saving and reading posts. Still I'm a big of this CMS Smile
nvinanda Wrote:In case GetSimple solves this issue, please update to this thread. I know its difficult because you need to change the whole algorithm of saving and reading posts. Still I'm a big of this CMS Smile

CMS'es you have mentioned prevent editors from saving articles named the same as one of already existing article.
Some CMS'es will automatically add a char by the end/at front (mostly article's ID), some will show an alert and will prevent article from being saved.
Other one will base on article's ID in url, thus there won't be any problems with duplicated names.
But then you'd come up with: "I want to have SEF URLs".

If you still have a problem with that, just add current date to URL when upon article creation, or add a small piece of code to GS article save function, to make this process automatic.
Did anyone find workaround/hack for this? I would also like to see more than 2 levels in url.
I guess maybe the core could be modified to use subfolders for storage, or maybe you can name your slugs
parent2_subpage

Then have an apache rewrite to always add the parent2 to your subpages if they match a specific name. Then your urls can be whatever you want regardless of your slug names.
I second this problem,

I run a film based website, so i have different names for films but they all should have the same page names, eg i want.

www.example.com/film-a/plot/
www.example.com/film-a/media/

www.example.com/film-b/plot/
www.example.com/film-b/media/


However i am stuck with having to use

www.example.com/film-a/plot/
www.example.com/film-a/media/

www.example.com/film-b/plot-1/
www.example.com/film-b/media-1/

Could the filename not have a small unique identifyer saved with the .xml name, which strips it out and only uses the user defined slug name?
acasperw Wrote:Could the filename not have a small unique identifyer saved with the .xml name, which strips it out and only uses the user defined slug name?

It could if we were at the 1.0 release. It was an assumption i made 2 years ago, that turned out to be not the best, but it's something that would take A LOT of change at this point to fix
ccagle8 Wrote:
acasperw Wrote:Could the filename not have a small unique identifyer saved with the .xml name, which strips it out and only uses the user defined slug name?

It could if we were at the 1.0 release. It was an assumption i made 2 years ago, that turned out to be not the best, but it's something that would take A LOT of change at this point to fix

I totally understand, i think its something you should look into for a future release, as its not a isolated incident, and it seems like a logical move forward.
Ill post this again.

As a workaround, can you perhaps use.

Code:
http://www.example.com/film-a/film-a_plot/
http://www.example.com/film-a/film-a_media/
http://www.example.com/film-b/film-b_plot/
http://www.example.com/film-b/film-b_media/

And use a apache rewrite rule to match the root and prepend it to your slug url so your urls can look like this ?

Code:
http://www.example.com/film-a/plot/
http://www.example.com/film-a/media/

End users will never know the true internal path.
shawn_a Wrote:Ill post this again.

As a workaround, can you perhaps use.

Code:
http://www.example.com/film-a/film-a_plot/
http://www.example.com/film-a/film-a_media/
http://www.example.com/film-b/film-b_plot/
http://www.example.com/film-b/film-b_media/

And use a apache rewrite rule to match the root and prepend it to your slug url so your urls can look like this ?

Code:
http://www.example.com/film-a/plot/
http://www.example.com/film-a/media/

End users will never know the true internal path.

Thanks ill look into it, however my knowledge of Apache rules extend to allowing my forum to be excluded from get simple rules and simple "Website down for maintainance" redirect pages.
I want to do this too - could anyone help with the rewrite rule workaround? I'm a little lost.