Question

I have a requirement where the CMS admin will create the content [Article] page from my CMS.

In the Article, there will be lot of sub headers enclosed with <h3> </h3> tags.

When i render this article in a web page, i should paginate the article with the number of Sub Headers in it. Like, if there are 5 sub headers in one article, it should be possible to navigate to each sub headers by clicking the pagination. So I should dynamically create a pagination for each Sub Headers.

Note : All the sub headers will render in same .aspx page, I should see only one sub header at one time.

My Question is, what would be the best way to accomplish this ? Should i search for tags in the HTML and put each section is a div and show it ? Any better ideas...?...

The CMS i am using is Ektron.

Was it helpful?

Solution

Dude , this could be simply implemented using JQuery.
Assuming only one article is rendered on one page :

Add a class to the h3 elements according to the index of it on the page.

 $('h3').addClass($(this).index())help 

And render page numbers according to :

$('h3').size()

And then according to the page number show the related <h3> tag and hide the others using

$('h3:not(.[your page number])').hide();

This should do the trick. There should be better ways to do it, but this will work.

Also you should be careful about using such tags coz issues occur when designers and developers are coding simultaneously so be careful about it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top