Re: Browse element with headline

48 views
Skip to first unread message
Message has been deleted

Jian Huang

unread,
Mar 15, 2012, 9:26:27 AM3/15/12
to reddot-c...@googlegroups.com
Hi Neil,

Out of box, probably not, but here is the JavaScript/AJAX code to do it

<a href="<%hit_lst_page_next%>" id="next-page-link">next</a>

<script>
$.get("<%hit_lst_page_next%>", function(data){
// assuming the headline of the page in within <h2>
var next_page_headline = $(data).find("h2").text();

// replace next text with next page headline
$("#
next-page-link").text(next_page_headline); });
</script>

Hope that helps.

-Jian


On Thursday, March 15, 2012 7:09:36 AM UTC-4, Neil Fegen wrote:

Hi guys

I've been using the browse element to list the next and previous page in a list of news articles, which works well.

Is it possible to also pull through the title of the next/previous page, with rendertags or otherwise? Bit disappointing that the element is only capable of getting the URL and not headline.

Thanks

Neil
Message has been deleted

Jian Huang

unread,
Mar 15, 2012, 9:58:10 AM3/15/12
to reddot-c...@googlegroups.com
Sooo close

It is

$("#next-page-link").attr("title", next_page_headline)

On Thursday, March 15, 2012 9:52:41 AM UTC-4, Neil Fegen wrote:
Jian, you're a star - is it much different to change the <a> title tag too?

Guessed at $("#next-page-link").title(next_page_headline)but no luck...

Thanks

Neil
Reply all
Reply to author
Forward
0 new messages