For example, today I will show you how to turn it into a widget flows for each label. Convenient for users not wishing to receive a specified portion of the publications of a blog.
first step : Add widget "Labels"
In the management table, go to Presentation / Page Elements and insert the widget as shown in the example image below.
1. Add a gadget
2. Choose the gadget "Tag"
3. Configure the gadget to your liking
4. Register and get a list of labels for your blog. He just have to modify the code.
Step 2: Find code
Now go to the page of the HTML editor of your blog and find the lines corresponding to the widget (Expand Widget Templates)
The original code for the widget:
\u0026lt;b : widget id = 'Label1' locked = 'false' title = 'Labels' type = 'Label'>
\u0026lt;b : includable id = 'main'>
\u0026lt;b:if cond='data:title'>
\u0026lt;h2> \u0026lt;data:title/> \u0026lt;/ h2>
\u0026lt;/ b: if>
\u0026lt;expr div: class = 'widget-content " " + data: display + "-label-widget-content " & # 39;>
\u0026lt;b:if cond='data:display == "list"'>
\u0026lt;ul>
\u0026lt;b: loop values = & # 39; data: labels 'var =' label '>
\u0026lt;li>
\u0026lt;b: if cond =' data: blog.url == data:label.url'>
<span expr:dir='data:blog.languageDirection'><data:label.name/></span>
<b:else/>
<a expr:dir='data:blog.languageDirection' expr:href='data:label.url'><data:label.name/></a>
</b:if>
<b:if cond='data:showFreqNumbers'>
\u0026lt;span dir='ltr'> (\u0026lt;data:label.count/>) \u0026lt;/ span>
\u0026lt;/ b: if>
\u0026lt;/ li>
\u0026lt;/ b: loop>
\u0026lt;/ ul>
\u0026lt;b:else/>
\u0026lt;b:loop values='data:labels' var='label'>
\u0026lt;span expr:class='"label-size label-size-" + data:label.cssSize'>
<b:if cond='data:blog.url == data:label.url'>
<span expr:dir='data:blog.languageDirection'><data:label.name/></span>
<b:else/>
<a expr:dir='data:blog.languageDirection' expr:href='data:label.url'><data:label.name/></a>
</b:if>
<b:if cond='data:showFreqNumbers'>
\u0026lt;span class='label-count' dir='ltr'> (\u0026lt;data:label.count/>) \u0026lt;/ span>
\u0026lt;/ b : if>
\u0026lt;/ span>
\u0026lt;/ b: loop>
\u0026lt;/ b: if>
\u0026lt;b:includable name='quickedit'/>
\u0026lt;/ div>
\u0026lt;/ b: includable>
\u0026lt;/ b: widget>
3rd stage : Modify the code
Replace the original code by it.
The new widget code:
\u0026lt;b: widget id = 'Label1' locked = 'false' title = 'Feed Labels' type = 'Label'>
\u0026lt;b:includable id='main'>
\u0026lt;b:if cond='data:title'>
\u0026lt;h2> \u0026lt;data:title/> \u0026lt;/ h2>
\u0026lt;/ b: if>
expr:class='"widget-content \u0026lt;div " + + data:display "-label-widget-content"'>
\u0026lt; b: if cond = 'data: display == " " list'>
\u0026lt;ul>
\u0026lt;b: loop values = 'data: labels' var = 'label'>
\u0026lt;li>
\u0026lt;a expr: href = quot dir = '&' data: blog.languageDirection 'expr ; / feeds/posts/default/- / " + Data: label.name 'expr: title = "" You subscribe to the rss category + data ": " label.name +. & Quot ; 'target =' _blank '> \u0026lt;data:label.name/> \u0026lt;/ a>
\u0026lt;b: if cond =' data: showFreqNumbers' ;> \u0026lt;span
dir='ltr'> (\u0026lt;data:label.count/>) \u0026lt;/ span>
\u0026lt;/ b: if>
\u0026lt;/ Li>
\u0026lt;/ b: loop>
\u0026lt;/ ul>
\u0026lt;b:else/>
\u0026lt;b: loop values = 'data: labels' var = & # 39; label '>
\u0026lt;span expr:class='"label-size label-size-" + data:label.cssSize'>
\u0026lt; a expr: dir = 'data: blog.languageDirection' expr: href = '" / feeds/posts/default/- / " + data: label.name' ; expr: title = "" You subscribe to the rss category " + data: + label.name ". "" target = & # 39; _blank '> \u0026lt;data:label.name/> \u0026lt;/ a>
\u0026lt;b:if cond='data:showFreqNumbers'>
\u0026lt;span class = 'label-count' dir = 'ltr'> (\u0026lt;data:label.count/>) \u0026lt;/ span>
\u0026lt;/ b: if>
\u0026lt;/ span>
\u0026lt;/ b: loop>
\u0026lt;/ b: if>
\u0026lt;b:includable name='quickedit'/>
\u0026lt;/ div>
\u0026lt; / b: includable>
\u0026lt;/ b: widget>
Explanations:
The new code was written so that it can adapt to all configurations offered by Blogger (list, cloud with or without number).
Conditional Tags \u0026lt;b: if cond = 'data: blog.url == data: label.url'> which showed whether or not the link to data pages have been deleted. Tags Only "links" have undergone a transformation:
\u0026lt;a expr: dir = 'data: blog.languageDirection' expr: href = 'data: label.url & # 39;> becomes
\u0026lt;a expr: dir = 'data: blog.languageDirection' expr: href = '" / feeds / posts / default / - / + " data: label.name ' expr: title = "" You subscribe to the rss category " + data: + label.name ". "" target = & # 39; _blank '> . Instead of having a link that leads to the index of a language, it leads directly to the page flow by opening a new tab with
target = '_blank' . I also inserted a text for the tooltip which contains the label name. You can change it at your convenience.
Formatting
The code has undergone a minor alteration, the CSS of your blog need not be changed.
And finally, finally, you can see a preview of this widget converted:
• On our blog demo: http://bloggercodedemo.blogspot.com/
• On our blog demo: http://bloggercodedemo.blogspot.com/
0 comments:
Post a Comment