How to make {{DETAILURL}} SEO-Friendly?
Permalink Browser Info Environment
Hi there, love this addon. I've just imported 200 rows of data from an old site. Having a bit of a dilemma trying to have dynamically generated detail pages. Basically, I just want the {{DETAILURL}} to generate something like :
/features/thoughts-blog/2011/title/
instead of
/features/thoughts-blog/?ref_cID=84&bID=217&dd_asId=799
Can I use URL rewriting in the htaccess to pass a 'handle'?
thoughts-blog/?handle=example-handle
Is this possible? Or do I have to generate all of the pages within C5's sitemap?
Cheers!
/features/thoughts-blog/2011/title/
instead of
/features/thoughts-blog/?ref_cID=84&bID=217&dd_asId=799
Can I use URL rewriting in the htaccess to pass a 'handle'?
thoughts-blog/?handle=example-handle
Is this possible? Or do I have to generate all of the pages within C5's sitemap?
Cheers!
Type: | Discussion |
---|---|
Status: | New |
Thanks Justin, that's kind of what I thought.
I've already built the page type with the data display block embedded and did try already to import all the pages. Started moving two hundred pages in the Sitemap and decided there's gotta be an easier way.
Do you know of any shortcut for mass deleting or mass moving of pages in C5?
Cheers!
I've already built the page type with the data display block embedded and did try already to import all the pages. Started moving two hundred pages in the Sitemap and decided there's gotta be an easier way.
Do you know of any shortcut for mass deleting or mass moving of pages in C5?
Cheers!
I thought there was an add on that did something similar to this, but I'm not seeing anything out there right now that fits that description. You might try posting to the forums to see if anyone has any tools out there that might accomplish this purpose.
We had a similar problem in our site, needing to move 400+ pages from underneath one parent to another. I'm posting here the utility that I wrote to do this and you are welcome to it, with the caveat that it wasn't really scripted with any long-term plans. More like a pragmatic, bare-bones, get-the-job-done sort of utility.
In other words, make sure you test this in an inconspicuous area before you try to move a bazillion pages.
There is a read me file in there that should get you started installing, but if you get stuck just holler and I'll add more detail.
In other words, make sure you test this in an inconspicuous area before you try to move a bazillion pages.
There is a read me file in there that should get you started installing, but if you get stuck just holler and I'll add more detail.
I should mention here that the script deliberately maintains the legacy paths as additional page paths, so that the pages could be accessed from either URL. If you don't want this behavior, you should comment out that part of the code.
Hey Brenna and Justin, thank you both so much for your time with this.
Here's what I ended up doing :
1. To move the huge pile of pages in the root using the Utility from Brenna didn't work as I didn't want to move everypage from the root and there's no per-page selection. What I did is run a SQL to delete between certain cID's in 'Pages' and 'PagePaths'. I know, dangerous, but it worked.
2. To import pages into a specific directory I just changed a pair of values in Kino's PageMaker script (controller, starting line 60) :
Where 'PARENT-cID' is the Parent cID and '/PATH/TO/PAGE' is the Parent Path.
Worked like a charm to import 200+ page to their rightful place in my sitemap.
Here's what I ended up doing :
1. To move the huge pile of pages in the root using the Utility from Brenna didn't work as I didn't want to move everypage from the root and there's no per-page selection. What I did is run a SQL to delete between certain cID's in 'Pages' and 'PagePaths'. I know, dangerous, but it worked.
2. To import pages into a specific directory I just changed a pair of values in Kino's PageMaker script (controller, starting line 60) :
$pt = Page::getByID(PARENT-cID); foreach ($fld as $page_){ $pl = PageTheme::getByHandle($page_[3]); if(isset($page_[4]) && !empty($page_[4])){ $pt = $this->Pages[$page_[4]]; $pagepath = $pt->cPath . "/PATH/TO/PAGE/{$page_[1]}"; } else { $pt = Page::getByID(PARENT-cID); $pagepath = "//PATH/TO/PAGE/{$page_[1]}"; }
Where 'PARENT-cID' is the Parent cID and '/PATH/TO/PAGE' is the Parent Path.
Worked like a charm to import 200+ page to their rightful place in my sitemap.
Out of curiosity, if you wanted to move pages on a per-page basis, why not just use c5's already built-in interface? Or do it folder by folder?
> why not just use c5's already built-in interface?
Started moving two hundred pages in the Sitemap and decided there's gotta be an easier way. By 'per page', I guess I was dreaming of a huge list of pages and being able to select certain of them for moving, like the File Manager in CPanel. Under home, I wanted to select and move 200 pages, but not 8, definitely not those 8. Anyway, circumvented the need for moving by importing them direct anyway.
> Or do it folder by folder?
Kino's import utility, by default, puts everything under Home.
Started moving two hundred pages in the Sitemap and decided there's gotta be an easier way. By 'per page', I guess I was dreaming of a huge list of pages and being able to select certain of them for moving, like the File Manager in CPanel. Under home, I wanted to select and move 200 pages, but not 8, definitely not those 8. Anyway, circumvented the need for moving by importing them direct anyway.
> Or do it folder by folder?
Kino's import utility, by default, puts everything under Home.
Ah! got it -- so all the files you wanted to move were under the root, but you didn't want to move *all* pages under the root somewhere else.
My vote for upgrades to future editions of concrete5 would be to have checkboxes next to each page in the site map for some sort of bulk action -- delete, move, etc...which would basically be an extension of the functionality they already have built in for page properties.
Glad you got your issue resolved.
My vote for upgrades to future editions of concrete5 would be to have checkboxes next to each page in the site map for some sort of bulk action -- delete, move, etc...which would basically be an extension of the functionality they already have built in for page properties.
Glad you got your issue resolved.
I have several hundred records in a form that I imported. Obviously because of the issue you stated above about the SEO urls only working when you manually create the page, none of the imported records have pages associated with them. Thats fine, however from this point forward I am generating pages w/ SEO links for new records, but it seems as though even with the new records the old non-SEO url is still being displayed in the Data Display template (using {{DISPLAYURL}}). Can you not mix and match the SEO and non-SEO urls in a template? Sorry if this doesn't make sense, I can send you some screenshots if that helps.
Nevermind, I swapped DETAILURL out with PAGEURL and that took care of it - what is the difference?
{{DETAILURL}} always generates the non-SEO-friendly URL. {{PAGEURL}} links to the associated page, or the non-SEO-friendly URL if no associated page is specified.
Here's the current downside for your situation - this is not built into the import process as of yet. It currently only happens when you add a record manually.
So, as of right now, you're only option would be to manually create the pages, manually add the "Data Display Detail" block to each page, and then manually associate each record with it's page.
I know that's probably not the best news for you, but I will certainly look at adding the automated page generation to the import process.