Categories sample files
Hi,
Watching this:
https://docs.grabaperch.com/video/tutorials/techniques/portfolio-with-categories/
Wondered if the files you show in the video are available for me to work from as it's easier than we keying in the code from scratch - easier for me to get my head round things this way.
Thx.
I don't think so with this one, but there's not really a lot to enter.
Ok, just having trouble working out exactly what's in the code from the small video.
The code is in the transcript - can you not copy and paste it?
So far, I'm having real trouble getting the categories to work.
I've added the main files from your video and I am getting it to work in the CMS but not outputting pages at the moment.
If you are stuck, I've got a working version here, some slight changes to the tutorial because I renamed one of the templates but might help
Appreciate that Clive. How might I be able to grab a copy of the templates?
I can post the relevant template here? Which template are you stuck with?
It's basically all of the ones in this video:
https://docs.grabaperch.com/video/tutorials/techniques/portfolio-with-categories/
Not sure I need all of them but most.
Otherwise I must be doing something else wrong as not getting an output on the page.
OK, here is portfolio_listing.html template
and this one is list_detail_portfolio_item.html (in the tutorial, this is called portfolio_item.html).
and this is category_single.html
I think these are pretty much the same as the tutorial video but I may have changed image sizes.
Thank you very much for the code.
It's got me a lot further.
The Listing page is working.
But when I click through to the detail page I'm getting an error that the page is not found.
There is a rewrite rule in an .htaccess file and this is needed for the detail page link to work, it's mentioned in the tutorial and video. If you create the same rule, as long as your server supports URL rewrites, the detail page link should work.
This is what I've got in the .htaccess file
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^detail/([a-zA-Z0-9-/]+)$ /detail.php?s=$1 [L] </IfModule>
But doesn't display the detail page.
That looks correct.
If it were me, I would check the server supports URL rewrites, check the detail.php page is in the correct location, then enter the actual detail.php?s=slug URL and check that works.
.... then check my code again.
What URL are you attempting to view the detail page at, and what result are you getting?
At the moment, the rule you have is looking for a URL like
and rewriting that to
At the moment the listing page call this url:
/perch/detail/slug-name-here
it's not putting a .php or query string at end. That's probably because I have the entries in my .htaccess file.
The files shouldn't be inside your Perch folder.
Ah Ok.
So I've got my perch install in a folder /perch/
I've put my website pages in /perchtestsite/
Added: <?php include('/perch/runtime.php');?> to the top of the pages I want to use in Perch.
Empty page and doesn't show up in Perch to add content too even after refreshing the web page in browser.
Your website folder lives beside the perch folder, correct? Then you want to put ".." in front of "/perch/runtime.php".
Thanks. Got that up and running I would have thought /perch/runtime.php would have works but I won't argue.
Right, all back up and running but still the issue remains that when I click through from the listing page to the detail page I get a not found error.
The url is something like this:
https://www.xxx.com/perch/detail/slug-name-here