Easy News how to add title and date to main article
Permalink 1 user found helpful
Hi I have managed to add the date to the main news via easy_news\blocks\easynews_list\view.php page using this:
<a href="<?php echo $nh->getLinkToCollection($cobj)?>"><?php echo $title?> - <?php echo strftime("%d . %m . %Y", strtotime($cobj->getCollectionDatePublic())); ?></a>
Now I would like to add to the main article once clicked.
Any ideas how to do this, it would be nice to add a back button which I have done successfully in other page using this method:
<a href="<?=$parent_url?>">Back</a>
Thanking yuo in advance!
Mauricio
<a href="<?php echo $nh->getLinkToCollection($cobj)?>"><?php echo $title?> - <?php echo strftime("%d . %m . %Y", strtotime($cobj->getCollectionDatePublic())); ?></a>
Now I would like to add to the main article once clicked.
Any ideas how to do this, it would be nice to add a back button which I have done successfully in other page using this method:
<a href="<?=$parent_url?>">Back</a>
Thanking yuo in advance!
Mauricio
Good to hear, I still want to add a back button have you worked this out?
Try something like:
<?php $cParent = Page::getByID($c->getCollectionParentID()); $nh = Loader::helper('navigation'); ?> <a href="<?=$nh->getLinkToCollection($cParent)?>">Back</a>
Thanks KJL I will try on an upcoming project very shortly!
Hi KLJon
I maged to add the time and a read more img to the summary of the story/ front of news now i would like to add either a:
1. Breadcrumb to the actual story / level 2
2. a back button like the readmore
Also add add the title in level 2
Code of my view.php below, any ideas?
I maged to add the time and a read more img to the summary of the story/ front of news now i would like to add either a:
1. Breadcrumb to the actual story / level 2
2. a back button like the readmore
Also add add the title in level 2
Code of my view.php below, any ideas?
<?php defined('C5_EXECUTE') or die(_("Access Denied.")); $textHelper = Loader::helper("text"); // now that we're in the specialized content file for this block type, // we'll include this block type's class, and pass the block to it, and get // the content if (count($cArray) > 0) { ?> <div class="ccm-page-list"> <?php for ($i = 0; $i < count($cArray); $i++ ) { $cobj = $cArray[$i]; $title = $cobj->getCollectionName(); ?> <h2 class="ccm-page-list-title"><a href="<?php echo $nh->getLinkToCollection($cobj)?>"><?php echo $title?> - <?php echo strftime("%d . %m . %Y", strtotime($cobj->getCollectionDatePublic())); ?></a></h2> <?php if ($cobj->getCollectionTypeHandle()=="Press Release") { ?> <h4><?php echo $cobj->getCollectionAttributeValue('Press_Release_Type'); ?> - for release on <?php echo strftime("%x %l:%M%p",strtotime($cobj->getCollectionAttributeValue('Release_Date'))); ?></h4>
Viewing 15 lines of 45 lines. View entire code block.
You greatly helped my case with your inquiry :)
It solved a great puzzle, I was trying to merge 2 functions to print out the published dates in english/french pages.
see:http://www.concrete5.org/index.php?cID=156511&editmode=1...