Error displaying titles
Permalink 1 user found helpfuli added a getCollectionName into a custom view.php file for the content block, because i use tony rapid ajax paging block to display the main content of blog pages. i first tried using a content block with a page title attribute, but this was always rendering the page it was on.
then i tried this method, and it's working on ajax loads, but doing something similar when it's loaded with the page teasers add on.
i've written the add on developer, but i'm also reaching to the community to see if anyone has a simple solution, as i really need to wrap up this site.
here is one of the problem pages, as you can see every title on this page reads "blog" instead of actual titles.
http://ladyapples.com/index.php?cID=191...
i've seen a few similar cases, but am unsure if they would help or where i could add the code. here is one similar topic perhaps.
http://www.concrete5.org/community/forums/customizing_c5/get-page-t...
does anyone have a practical workaround? seems like it would be a simple case to crack, but i'm not seeing it quite yet.
thanks in advance.

Paid add-on include free support. Tony knows his product better than anyone. I would ask him.
Yeah maybe someone else can chime in. Thanks for writing.
if i can just get some syntax help that would be extremely helpful.
so the way to get titles is through a custom template in ajax, but now for the blog entries, i need to differentiate the page types whether to include dates or not. (portfolio won't have dates)
here's the outlined code, could you or someone just help with the formatting, please?
thanks so much.
<? defined('C5_EXECUTE') or die(_("Access Denied.")); global $c; ?> <h1><?= $c->getCollectionName() ?></h1> // title, works good <p> <?= $pageType->c->getCollectionTypeHandle() if { $pagetype = left_sidebar_blog } then { <? php date( 'F j, ', (strtotime($c->getCollectionDatePublic()) ) ) ?>2071 } else {nothing} </p> // rest is fine
<?php defined('C5_EXECUTE') or die("Access Denied."); global $c; ?> <h1><?php echo $c->getCollectionName(); ?></h1> // title, works good <p> <?php $pagetype = $c->getCollectionTypeHandle(); if ($pagetype == 'left_sidebar_blog'){echo " ~ " . date( 'F j, ', (strtotime($c->getCollectionDatePublic())));} ?> </p>
Try not to use php short codes such as "<?=". Use "<?php echo" instead because I've run across some servers where php short codes are disabled. Also with the rise of XML, browsers are going to start getting confused.
ive gotten most of it to work, but now when i use the top menu links (portfolio, blog offerings) there is an extra title that pops up...?
here is the closest thing i could come up with, based on hawk's date navigation edit:
<?php defined('C5_EXECUTE') or die("Access Denied."); global $c; ?> <?php $pagetype = $c->getCollectionTypeHandle(); if ($pagetype == 'left_sidebar_blog' , 'left_sidebar_main'){<h1><?php echo $c->getCollectionName(); ?></h1> <p>} <?php $pagetype = $c->getCollectionTypeHandle(); if ($pagetype == 'left_sidebar_blog'){echo " Posted on " . date('F j, Y, g:i a', (strtotime($c->getCollectionDatePublic())));} ?> </p> <?= $innerContent ?>
http://ladyapples.com/index.php/tools/packages/tony_rapid_paging/se...
are you sure that those pages aren't of the type "left_sidebar_blog" or "left_sidebar_main"?
if they're not and it's still not working, then try changing the if condition to this:
($pagetype == 'left_sidebar_blog' || $pagetype == 'left_sidebar_blog' 'left_sidebar_main')
So in the ajax template, would this be the correct way to make sure only main and blog pages get titles?
<?php $pagetype = $c->getCollectionTypeHandle(); if ($pagetype == 'left_sidebar_blog''left_sidebar_main')){echo " <h1><?php echo $c->getCollectionName(); ?></h1> " ?> <p> <?php $pagetype = $c->getCollectionTypeHandle(); if ($pagetype == 'left_sidebar_blog'){echo " Posted on " . date('F j, Y, g:i a', (strtotime($c->getCollectionDatePublic())));} ?> </p>
Adrien. .::[ ゆ ]::.
> On Jan 14, 2014, at 9:56, concrete5 Community <discussions@concretecms.com> wrote:
<?php $pagetype = $c->getCollectionTypeHandle(); if ($pagetype == 'left_sidebar_blog' || $pagetype == 'left_sidebar_main'){ ?> <h1><?php echo $c->getCollectionName(); ?></h1> <? } ?> <p> <?php $pagetype = $c->getCollectionTypeHandle(); if ($pagetype == 'left_sidebar_blog'){ echo " Posted on " . date('F j, Y, g:i a', (strtotime($c->getCollectionDatePublic()))); } ?> </p>