Archived

This topic is now archived and is closed to further replies.

  • 0

Resolved Adding Anchor Tag To Banner Titles

Question

Posted · Report post

Hi,

i have added anchor tags on banner titles to aid site navigation. It was working great until the most recent pagelines update. Now I've had to remove them because part of the html shows up on the page

I would add something like this:

<a name="banner 1"></a>Banner Title

Untitled.jpg

how can i get the anchor tag to appear with the banner title?

If i add it in the content of the banner instead, then the title of the banner is cut off from view when linked

Share this post


Link to post
Share on other sites

21 answers to this question

Posted · Report post

Hi,

Can you tell me where abouts your adding this anchor code please.

I have been adding them to the title field of the banner (it used to work, until the newest update of pagelines).

Share this post


Link to post
Share on other sites

Posted · Report post

It used to work, as there was a bug, the alt was always blank, you were exploiting a bug!

A customer pointed it out and the bug was fixed, the image alt is always the banner title now.

If you want to change that html there is a filter provided. Take a look at the banners section.php

Share this post


Link to post
Share on other sites

Posted · Report post

It used to work, as there was a bug, the alt was always blank, you were exploiting a bug!

A customer pointed it out and the bug was fixed, the image alt is always the banner title now.

If you want to change that html there is a filter provided. Take a look at the banners section.php

I opened up the section.php in the banners section and I can't figure out what where to find the filter.

Share this post


Link to post
Share on other sites

Posted · Report post

Line 278 of section.php

Share this post


Link to post
Share on other sites

Posted · Report post

Line 278 of section.php

i have a very rudimentary understanding of javascript. Could you explain to me what i would need to do to modify it?

Share this post


Link to post
Share on other sites

Posted · Report post

Change that block of code to this:


function _get_banner_media( $oset ){

if(plmeta('the_banner_image', $oset))
$banner_media = '<img src="'.plmeta('the_banner_image', $oset).'" alt="'.get_the_title( $oset['post_id'] ).'" title="' .get_the_title( $oset['post_id'] ) . '"/>';
elseif(plmeta('the_banner_media', $oset))
$banner_media = do_shortcode( plmeta('the_banner_media', $oset) );
else
$banner_media = '';

// Filter output
return apply_filters('pl_banner_image', $banner_media, $oset);
}[/CODE]

Share this post


Link to post
Share on other sites

Posted · Report post

Change that block of code to this:


function _get_banner_media( $oset ){


if(plmeta('the_banner_image', $oset))

$banner_media = '<img src="'.plmeta('the_banner_image', $oset).'" alt="'.get_the_title( $oset['post_id'] ).'" title="' .get_the_title( $oset['post_id'] ) . '"/>';

elseif(plmeta('the_banner_media', $oset))

$banner_media = do_shortcode( plmeta('the_banner_media', $oset) );

else

$banner_media = '';


// Filter output

return apply_filters('pl_banner_image', $banner_media, $oset);

}

I modified the section.php as suggested and it did not help. there is even more text below the image then before. When i look at the code using firebug, the code is being messed up around the banner image, while the banner title looks good.

Share this post


Link to post
Share on other sites

Posted · Report post

I dont understand what you are trying to do, you are using a link as your title?? A link with no destination?

Share this post


Link to post
Share on other sites

Posted · Report post

I dont understand what you are trying to do, you are using a link as your title?? A link with no destination?

i am using <a name="whatever"></a> as an anchor for site navigation. Using the anchor tag I can use page navigation and navbar navigation.

Share this post


Link to post
Share on other sites

Posted · Report post

The easiest way (not tested) would be to use CSS to hide the Banner title and then use <h1>Banner TItle</h1 in the Banner content editor. Then add your anchor there, this should work and is the easiest way of achieving the functionality you want.

Share this post


Link to post
Share on other sites

Posted · Report post

The easiest way (not tested) would be to use CSS to hide the Banner title and then use <h1>Banner TItle</h1 in the Banner content editor. Then add your anchor there, this should work and is the easiest way of achieving the functionality you want.

I was hoping to avoid this, but i guess i will do this instead.

Share this post


Link to post
Share on other sites

Posted · Report post

Let us know if you need help with the CSS.

Share this post


Link to post
Share on other sites

Posted · Report post

Let us know if you need help with the CSS.

Thanks, but I think i have it down:

<div class="hidden">Banner Title</div>
.hidden {

visibility:hidden;

}[/code]

Share this post


Link to post
Share on other sites

Posted · Report post

Do you need further assistance with anything else?

Share this post


Link to post
Share on other sites

Posted · Report post

Do you need further assistance with anything else?

not on this topic. thanks

Share this post


Link to post
Share on other sites

Posted · Report post

The topic was marked as resolved.

Share this post


Link to post
Share on other sites

Posted · Report post

Hi there, I think you need to tweak the html slightly to


<a name="banner 1">Banner Title</a>


Share this post


Link to post
Share on other sites

Posted · Report post

Ok looking in your source code it's mixing up your html and adding it as an alt name for the image above.


<div class="banner-media-pad pprand-pad">

<img commission"="" alt="<a name=" src="http://hireconrad.com/hireconrad/wp-content/uploads/2012/09/save-commission.png">

Competitive Commission" />

</div>

Try adding your text into a separate Div, I've just done the same on my test site. Screenshot - http://screencast.com/t/M6parlDKfPF

<div id="myDiv" name="myDiv"

<p>This paragraph would be your content paragraph...</p>

</div>

Share this post


Link to post
Share on other sites

Posted · Report post

Ok looking in your source code it's mixing up your html and adding it as an alt name for the image above.


<div class="banner-media-pad pprand-pad">

<img commission"="" alt="<a name=" src="http://hireconrad.com/hireconrad/wp-content/uploads/2012/09/save-commission.png">

Competitive Commission" />

</div>

Try adding your text into a separate Div, I've just done the same on my test site. Screenshot - http://screencast.com/t/M6parlDKfPF

<div id="myDiv" name="myDiv"

<p>This paragraph would be your content paragraph...</p>

</div>

Are you suggesting I not add a banner title, and put in the title in the body of the banner instead?

Ive tried wrapping the banner title in a div, but it doesn't fix the issue.

Any idea why the code is being messed up? a pagelines bug? (it used to work fine until the newest update).

Share this post


Link to post
Share on other sites

Posted · Report post

Hi,

Can you tell me where abouts your adding this anchor code please.

Share this post


Link to post
Share on other sites