5.7.5.1 Autonav SEO

Permalink 1 user found helpful
Hey all,

As some of you know, our firm is extremely big on perfecting SEO throughout the concrete5 platform. It's important to our team and clientele that each link on the website have the proper SEO elements associated with it.

In 5.6, we were able to add a custom page attribute for adding custom title tags to the autonav's links (echoed in the autonav block's view.php). In 5.7.5.1, we are unable to accomplish this simple addition.

Is there a way to add a custom page attribute into the CMS with the handle "page_title_meta", for example, and echo it into the autonav's view.php? This way, the links in the main navigation for website's would be customized on a per page basis. For example:

An autonav's page link would appear like this in the code:

<a href="/page-name" title="Custom Page Attribute">Page Name</a>

I know this is possible, but I can't figure out why we're unable to echo it accordingly. Can anyone help?

We really appreciate any advice you could provide. Thank you so much!

creativesolutions
 
JohntheFish replied on at Permalink Reply
JohntheFish
I haven't done any custom autonav work for 5.7, but I had a look at the 5.7 code while recently working on a series of 5.6 autonav customisations and there is very little difference. Its still the same old backward compatible series of kludges inside.

Whatever custom attribute tests you developed for 5.6 autonavs should be easily transferable to 5.7.
creativesolutions replied on at Permalink Reply
creativesolutions
Pardon me for this, but I believe I mentioned the incorrect block above. I meant to say the amiant CSS3 menu instead. Here is the entire view.php for that block that worked perfectly in 5.6. Please note the title="'.$_c->getCollectionAttributeValue('title_link_meta').'" area:

<?php   
   defined('C5_EXECUTE') or die("Access Denied.");
?>
   <div class="amiant-css3-menu-navigation-bar">
<?php  
   $aBlocks = $controller->generateNav();
   $c = Page::getCurrentPage();
   $containsPages = false;
   $nh = Loader::helper('navigation');
   //this will create an array of parent cIDs 
   $inspectC=$c;
   $selectedPathCIDs=array( $inspectC->getCollectionID() );
   $parentCIDnotZero=true;   
   while($parentCIDnotZero){
      $cParentID=$inspectC->cParentID;


What I meant to say was that we are trying to make this part of the new autonav itself. Again, my apologies.
JohntheFish replied on at Permalink Reply
JohntheFish
That code is similar to what all autonav view templates looked like before 5.6. But the 5.6 nav controller included all the obsolete code necessary to be compatible with old pre-5.6 templates. You may just be lucky if you just cut and paste it into a 5.7 autonav view template and see what happens. The requisite excess baggage to work with that code may still be in there.
creativesolutions replied on at Permalink Reply
creativesolutions
We tried that exact solution when we first started, but to no avail. Is there anything we can do to add this functionality for the title tags on the autonav?
JohntheFish replied on at Permalink Reply
JohntheFish
Nothing short of developing a new 5.7 autonav template for amniant.
creativesolutions replied on at Permalink Reply
creativesolutions
Cool. In that case, how should I echo out the custom page attribute for the autonav's view.php? It should be something like this in 5.7+:

<?php echo $c->getCollectionAttributeValue('attribute_handle') ?>

This is basically all we are trying to accomplish so that the title tag can be added on the per link basis pulled from the page's attribute. If we had that, we'd be ready to rock!

Any advice?
JohntheFish replied on at Permalink Best Answer Reply
JohntheFish
There are a bunch of examples in the default view.php.
creativesolutions replied on at Permalink Reply
creativesolutions
I didn't even see those! Thanks for helping me with this. I was able to create an attribute that worked perfectly. Thanks JohntheFish!!!