CMS Development

nhokloz1059
Member

How can I get all text in the h2 tags on my blog post.

SOLVE

I want to get all text in the h2 tags on my blog post body.

Anyone help me

0 Upvotes
1 Accepted solution
Designer_WOT
Solution
Contributor

How can I get all text in the h2 tags on my blog post.

SOLVE

Hello @nhokloz1059
      Just open the blog post template and you will find the  {{ content.post_body }in the post template's hubl code. just wrap that hubl with h2 tag like <h2>{{ content.post_body }}</h2> and all your post content will be in h2 tag.

Please note that this will wrap all the content having inline images, p tags everything. if you want spacific content than you have to use jQuery solution for it.

Hope this helps.

View solution in original post

6 Replies 6
Designer_WOT
Solution
Contributor

How can I get all text in the h2 tags on my blog post.

SOLVE

Hello @nhokloz1059
      Just open the blog post template and you will find the  {{ content.post_body }in the post template's hubl code. just wrap that hubl with h2 tag like <h2>{{ content.post_body }}</h2> and all your post content will be in h2 tag.

Please note that this will wrap all the content having inline images, p tags everything. if you want spacific content than you have to use jQuery solution for it.

Hope this helps.

nhokloz1059
Member

How can I get all text in the h2 tags on my blog post.

SOLVE

Thank you.

I'm done. Using jquery to get h2 tags. And add them into my category. Smiley Very Happy

0 Upvotes
Kevin-C
Recognized Expert | Partner
Recognized Expert | Partner

How can I get all text in the h2 tags on my blog post.

SOLVE

Hello,

 

You want to get all the h2 text, and do what with it?

 

If you just want to get it, I guess you could use the jquery ".text()" method and create an arry from the data.

Kevin Cornett - Sr. Solutions Architect @ BridgeRev
0 Upvotes
nhokloz1059
Member

How can I get all text in the h2 tags on my blog post.

SOLVE

I want to create auto category by get h2 tags.

0 Upvotes
Kevin-C
Recognized Expert | Partner
Recognized Expert | Partner

How can I get all text in the h2 tags on my blog post.

SOLVE

Ahhh! So this is extremely easy to do with jQuery which you may know.

 

Unfortunately I haven't the knowledge of how to do so with hubl. Or how to pass data between the two. I will continue to research and follow this thread. If you do find a solution please let us all know!

 

Thanks

Kevin Cornett - Sr. Solutions Architect @ BridgeRev
0 Upvotes
nhokloz1059
Member

How can I get all text in the h2 tags on my blog post.

SOLVE

Yes. Thank you. I am looking forward to your help.

0 Upvotes