Plugin: Weblog URL
Posted: 10 June 2008 07:38 AM   [ Ignore ]  
Lab Assistant
Avatar
RankRank
Total Posts:  194
Joined  02-02-2007

Hi,

I would like to present to your attention a new plugin - Weblog URL.

This plugin allows you to find weblog url as specified in weblog preferences.

PARAMETERS:

1) entry_id - Optional. Allows you to specify entry_id.

4) on_failure - (any string which consists from characters legal for use in ExpressionEngine’s tag parameter
values). Optional. Allows you to specify what {exp:weblog_url} tag will output in case an entry
having specified entry_id does not exist or the weblog to which entry was posted does not have
weblog url specified in preferences.

If you leave entry_id parameter undefined, you must use {weblog_url:entry_id_start}{weblog_url:entry_id_end}
variable pair.

EXAMPLE OF USAGE:

If entry_id is e.g. 246 then you can use optionally either single tag as here

{exp:weblog_url entry_id="246"}

or variable {weblog_url} within {exp:weblog_url}{/exp:weblog_url} tag pair as here

{exp:weblog_url entry_id="246"}
{entry_id_number}
{
/exp:weblog_url}

Both will return weblog url as specified in weblog preferences.

You will use {exp:weblog_url}{/exp:weblog_url} tag pair in case there is a need for
parse="inward" parameter.

You may also instead of specifying entry_id as parameter of {exp:weblog_url} to wrap it
with {weblog_url:entry_id_start}{weblog_url:entry_id_end} variable pair. For example the code
as this is possible:

{exp:weblog_url}
{exp
:weblog:prev_entry entry_id="110" category="5"}
<a href="{weblog_url:entry_id_start}{entry_id}{weblog_url:entry_id_end}{url_title}">Previous page: {title}</a>
{/exp:weblog:prev_entry}
{
/exp:weblog_url}
{exp
:weblog_url}
{exp
:weblog:next_entry entry_id="110" category="5"}
<a href="{weblog_url:entry_id_start}{entry_id}{weblog_url:entry_id_end}{url_title}">Next page: {title}</a>
{/exp:weblog:next_entry}
{
/exp:weblog_url}

If entry having entry_id specified in parameters or specified using
{weblog_url:entry_id_start}{weblog_url:entry_id_end} variable pair using does not exist,
then {exp:weblog_url} tag by default will return nothing. In case ‘on_failure’ parameter was defined,
then, in such case the tag will output what was specified as a value of this parameter.

Place this tag in any of your templates.

I have developed this plugin in order to be able to supply weblog url inside the output of {exp:weblog:prev_entry} and {exp:weblog:next_entry} tags. These tags does not allow to pull weblog url which is specified in weblog preferences. Instead you must use {path=template_group/template} variable. This is very constricting if previous/next entries belong to different weblogs and should be displayed using different templates.

File Attachments
pi.weblog_url.zip  (File Size: 3KB - Downloads: 46)
 Signature 

Full list of plugins here

Child Categories
Browser Sniff
Category Id
Entries List

Profile
 
 
Posted: 23 August 2008 07:58 AM   [ Ignore ]   [ # 1 ]  
Summer Student
Total Posts:  16
Joined  09-05-2007

some of your files, including this, seem to be corrupt

Profile
 
 
Posted: 23 August 2008 11:56 PM   [ Ignore ]   [ # 2 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  194
Joined  02-02-2007

Hi odspi,

Just downloaded the plugin and it seems to be OK. That is, after unzipping I can see all code from beginning <?php to the ending ?>.

Try to download it using another browser and write if anything goes wrong.

 Signature 

Full list of plugins here

Child Categories
Browser Sniff
Category Id
Entries List

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 10:33 AM
Total Registered Members: 61025 Total Logged-in Users: 30
Total Topics: 73808 Total Anonymous Users: 13
Total Replies: 398141 Total Guests: 459
Total Posts: 471949    
Members ( View Memberlist )
Newest Members:  alexwindb-rodMAIDENtreatstruckaungAdrian LeonP.T.Aoochoi2kfantomel