Alternate preview / page link

4 posts by 3 authors in: Forums > CMS Builder
Last Post: October 17, 2012   (RSS)

By mediaco - October 16, 2012

I have a list of pages (multi-record) and have the detail and preview pages information set accordingly.

Is there any possible way in the CMS, in the list view I could provide a direct link to the page? Opening in a new window/tab?

At the moment it shows the _link but it's not clickable.

Anyone else ever encounter this?

Re: [mediaco] Alternate preview / page link

By gregThomas - October 16, 2012

Hi Mediaco,

I'm not sure why your _link is currently not clickable, would it be possible to copy your code so far into a post for me?

Have you set up detail and list page viewer URL's for the section in the CMS Admin area? You can set these up by going to your CMS Admin area and then your section editors tab. Next click the modify link for the section you want to set up your _link for. Then click the Viewer URL's tab at the top of the section editing page. In this tab the second text box down should be called detail page URL, and you should add the details page file name in here.

Something like this should make links open in a new window for your list page:

<?php

list($recordVariable , $recordVariableMetaData) = getRecords(array(
'tableName' => 'tableNameHere',
'loadUploads' => true,
'allowSearch' => false,
));

?>
<?php foreach ($recordVariable as $record): ?>
<h3><?php echo htmlencode($record['title']) ?></h3><br/>
<br/><a target="_blank" href="<?php echo $record['_link'] ?>">Read More</a><br/>
<hr/>
<?php endforeach ?>


The target="_bank" will ensure that the link is loaded into a new window.

Thanks!
Greg Thomas







PHP Programmer - interactivetools.com

Re: [greg] Alternate preview / page link

By mediaco - October 17, 2012

I actually want a link to be placed in the CMSB.

Similar to how there are modify and delete buttons, I would like a link to take them directly to the created page.

I know I can use preview, but I don't want the preview.php-99999 stuff. I want them taken to the actual page.

In the CMSB on the list page I have outputted the _link in one column but it just shows the tail. I want it to be the full link and to be clickable.