Is there a Page Link Block that would allow clients to select a page in their site?
Permalink
I need to display the page title, custom image attribute and page URL from one page, on another page - and need the client to be able to select the specific page they want to pull this data from.
Essentially, I just need the "Insert Link to Page" function from the Content block BUT:
- As a separate block so the client can insert it and...
- Specify a custom template so I can pull the attributes they need to display
I guess I'm looking for a page_list block that allows the client to select a specific page instead of "Pages Beneath" etc.
Does anyone have a way to accomplish this?
Any pointers in the right direction would be much appreciated.
Essentially, I just need the "Insert Link to Page" function from the Content block BUT:
- As a separate block so the client can insert it and...
- Specify a custom template so I can pull the attributes they need to display
I guess I'm looking for a page_list block that allows the client to select a specific page instead of "Pages Beneath" etc.
Does anyone have a way to accomplish this?
Any pointers in the right direction would be much appreciated.
Or is there a way to use the page_list block and have the custom template grab the selected page instead of the pages beneath?
Yes I think this is also possible but I wouldn't see it as the right solution for the job because it would still add useless load by always loading the default structure when you just need to the page ID from the block.
The main issue with what you're describing is that my PHP knowledge is very much limited to customizing block templates.
So I don't really understand how to take the url that the designer content block (or the content block) creates and turn that into a CollectionName so I can pull the page attributes.
Does that make sense?
So I don't really understand how to take the url that the designer content block (or the content block) creates and turn that into a CollectionName so I can pull the page attributes.
Does that make sense?
Yeah, I didn't even remember designer content had the page link attribute so that already does the job for you for most parts!
Here's example of how to get the different details from the Page object, created with designer content in few minutes (thanks to its amazing author jordanlev of course :).
Here's example of how to get the different details from the Page object, created with designer content in few minutes (thanks to its amazing author jordanlev of course :).
Thanks heaps - worked perfectly.
For my own reference later on, I have the following as a custom template:
For my own reference later on, I have the following as a custom template:
<?php defined('C5_EXECUTE') or die("Access Denied."); $nh = Loader::helper('navigation'); ?> <?php if (!empty($field_1_link_cID)): $page = Page::getByID($field_1_link_cID); $link_url = $nh->getLinkToCollection(Page::getByID($field_1_link_cID), true); ?> <ul> <li> <h5><a href="<?php echo $link_url; ?>"><?php echo $page->getCollectionName(); ?></a></h5> </li> <li> <p> <a href="<?php echo $link_url; ?>"> <img class="full" alt="<?php echo $page->getCollectionName(); ?>" src="<?php echo($page->getAttribute('main_image')->getVersion()->getRelativePath());?>">
Viewing 15 lines of 26 lines. View entire code block.
try this package. It was build for this and even provides a sitemap selective to each user.
I never posted it to the C5 marketplace because it's such limited market of use, I didn't see it selling that many, and I can't afford to support ongoing something that doesn't sell. (support takes up a lot of time)
item as is. no support on it. on your own :-)
ChadStrat
I never posted it to the C5 marketplace because it's such limited market of use, I didn't see it selling that many, and I can't afford to support ongoing something that doesn't sell. (support takes up a lot of time)
item as is. no support on it. on your own :-)
ChadStrat
One possibility is to set the page attribute for the page instead of some specific block. But this would of course require you to hard code the output what content you want from that page. But then again, you could pretty fast create a block for that with the designer content.
To accomplish this you'll need to add the page selector attribute for your pages:
http://www.concrete5.org/marketplace/addons/page-selector-attribute...
Other option I could find find is Page Properties block but that would only allow you to display properties for the current page:
http://www.concrete5.org/marketplace/addons/page-properties/...
Probably if you take a look at them both and do some customizing, you can make a working solution that meets your needs.