Forum
Create a next and previous link in list and detail setup
I have created a typical news section using list and detail setup. Is it possible on the detail page to have a 'Next' link to go to the next detail page rather than going back to the list. Many thanks.
Ah ok...
https://solutions.grabaperch.com/architecture/how-do-i-link-prev-next
Where do I add the echo $result['html'];
In the following code? I am just getting blank page still. Many thanks
Add the
echo
wherever in the page you want that HTML to be output.Hi Drew
I'm going to need your patience.....
Ok list/detail works fine.
I add..as above
'skip-template' => true, 'return-html' => true,
Content disappears
So I need to add echo $result['html']; for it to reappear.
I have tried adding it at various points within the above code and after but no joy should it be wrapped in tags?
Near but not quite I'm afraid.
Please let me know if I'm intruding...
When you're saying
echo $result['html'];
, you're using PHP to tell your server to print out (or echo) the item in the array variable$result
that has the index "html". As it is now, you haven't defined the$result
variable yet, so the server can't echo any part of that variable; for all it knows,$result
doesn't exist.To fix this and define
$result
, just insert$result =
before the firstperch_content_custom(...)
in the code you've posted. Additionally,echo $result['html'];
has to appear after this definition. So you'd need something likeThis works because when
skip-template
is set to true,perch_content_custom
returns an array that you can save as a variable; in this case,$result
. Whenreturn-html
is set to true, the index "html" inside the returned associative array contains the region's HTML.Many thanks for your help. That's it.