1
DaveHaviland
Change entire presentation elements on the "News" module - any version

Using the Smarty variables and if/else statements, you can edit your news_item.html file (in Templates Menu) to exclude elements, or completely change the look of the news item based on who posted the story.

for my K-News Station site, I created a user named KNEWS, and if I post the story as that user (or, I just change it in 1.3) the entire "Posted By" line gets dropped. - here is the only thing I changed - other than creating the user:


<{if $story.author_name == "KNEWS"}>
<{else}>
                    <
td class="itemHead">
                        <
span class="itemTitle"><{$story.title}></span>
                    </
td>
                </
tr>
                <
tr>
                    <
td class="itemInfo">
                        <{if 
$story.files_attached}><{$story.attached_link}>&nbsp;<{/if}>
                        <{if 
$story.poster != ''}><span class="itemPoster"><{$lang_postedby}> <{$story.poster}></span><{/if}>
                        <
span class="itemPostDate"><{$lang_on}> <{$story.posttime}></span><{$news_by_the_same_author_link}>
                    </
td>
                </
tr>
<{/if}>



adding the:
<{if $story.author_name == "KNEWS"}>
<{else}>

statement made that entire loop disappear when the user who posted the story was "KNEWS"

- I don't know template editing very well, so it looks a little weird without it completely, but you can see how only things posted by "KNEWS" will have that element dropped.

So imagine using two or three different users setup, with a different presentation for each one.

edit: I then used the /if loop to tie in a second itemHead (itemHead2) to the css, then added that statement to the css, - to add the buffer I wanted.

Login

Username:
Password:

Lost Password? Register now!

Who's Online

37 user(s) are online (21 user(s) are browsing Support Forums)


Members: 0


Guests: 37


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Dec 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits