custom icon within weblog tag?
Posted: 27 June 2009 07:42 AM   [ Ignore ]  
Sr. Research Associate
Avatar
RankRankRankRankRank
Total Posts:  2651
Joined  06-01-2007

Hi,

I wonder how i can place custom icon image inside of weblog tag that does not specify any weblogs.

If i use this code

{exp:weblog:entries orderby="date" limit="2" disable="member_data|pagination|trackbacks"}
<h1>{title}</h1><br />
{body}<br />
{/exp:weblog:entries}

i want to put something like this after the H1-tag

{if weblog="one"><mig src="blaa" />{/if}

Only bad side, that code doesnt work so do you have ideas how i can use IFs or how i can place dynamicly icons after the title when i dont specify any weblogs?

Thanks and hope you understand what im after,
- Pete

 Signature 

Main project: EE Commercial 1.6.8 Build 20091201, EE MSM 1.1 Build: 20091201 and EE Forum Module 2.1.2 Build 20091202.
Public Beta project: EE Commercial 2.0.1 PB Build:  20100215 | MSM Version: 2.0 - Build:  20100215

Profile
 
 
Posted: 27 June 2009 07:55 AM   [ Ignore ]   [ # 1 ]  
Sr. Research Associate
Avatar
RankRankRankRankRank
Total Posts:  2651
Joined  06-01-2007

Ok i guess you cant use

<h1>{title}</h1> {if weblog == "shortname"}Test{/if}<br />

within the weblog entries tag? I tried this and it doest render the word “Test” after title if that is from certain weblog.

Or do i understand something badly wrong?

THanks:
- Pete

 Signature 

Main project: EE Commercial 1.6.8 Build 20091201, EE MSM 1.1 Build: 20091201 and EE Forum Module 2.1.2 Build 20091202.
Public Beta project: EE Commercial 2.0.1 PB Build:  20100215 | MSM Version: 2.0 - Build:  20100215

Profile
 
 
Posted: 27 June 2009 11:32 AM   [ Ignore ]   [ # 2 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  106
Joined  09-08-2006

There are a couple of weblog single variables you could use as conditional:

{weblog} The name of the weblog that the currently displayed entry is assigned to.
{weblog_id} The ID number of the actual weblog (not the entry)
{weblog_short_name} The short name of the weblog of the currently displayed entry.

I’d use it with a number so in the future if even the weblog name or weblog_short_name change your condition still works.

So, to make your code work and if the the short name of that weblog is “shortname”, then:

{if weblog_short_name == "shortname"}Test{/if}

See docs: http://expressionengine.com/docs/modules/weblog/variables.html#var_weblog_short_name

 Signature 

Stan Majerski
Elemental media

Profile
 
 
Posted: 27 June 2009 01:31 PM   [ Ignore ]   [ # 3 ]  
Sr. Research Associate
Avatar
RankRankRankRankRank
Total Posts:  2651
Joined  06-01-2007

Well thank you so much. I started to think is this even possible but it works with that variable. Didnt think “that far” so usual of me, heh!

With that conditional i can pull out (i think with few elseeif’s) 4 different kind of a images depending what weblog is the present entry written.

I’ll have to do this and thats now and see if i can make it!

Thanks
- Pete

 Signature 

Main project: EE Commercial 1.6.8 Build 20091201, EE MSM 1.1 Build: 20091201 and EE Forum Module 2.1.2 Build 20091202.
Public Beta project: EE Commercial 2.0.1 PB Build:  20100215 | MSM Version: 2.0 - Build:  20100215

Profile
 
 
Posted: 27 June 2009 02:44 PM   [ Ignore ]   [ # 4 ]  
Sr. Research Associate
Avatar
RankRankRankRankRank
Total Posts:  2651
Joined  06-01-2007

Yep, works like i want, thanks again!

- Pete

 Signature 

Main project: EE Commercial 1.6.8 Build 20091201, EE MSM 1.1 Build: 20091201 and EE Forum Module 2.1.2 Build 20091202.
Public Beta project: EE Commercial 2.0.1 PB Build:  20100215 | MSM Version: 2.0 - Build:  20100215

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 1743, on December 02, 2009 03:47 PM
Total Registered Members: 120416 Total Logged-in Users: 54
Total Topics: 126518 Total Anonymous Users: 29
Total Replies: 665271 Total Guests: 319
Total Posts: 791789    
Members ( View Memberlist )