Hide date in a sticky?

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
hudson-valley-dad
Regular
Posts: 40
Joined: Sun Feb 18, 2007 3:11 am

Hide date in a sticky?

Post by hudson-valley-dad »

How can I make my entry appear without a date? It is a welcome message at the top of the Blog. It sticks to the top with the help of "extended properties for entries" but it displays the date which I do not want.
Thanks!
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway »

Unfortunately you'll need to edit your template file to remove the date when a sticky entry is displayed. The default template (serendipity v3.0) already has the code to leave out the date for a sticky entry so I assume you're using a different template.

If you open entries.tpl from the template you're using in your favourite text editor, near to the top should be some code that adds the date. Can you check to see if your file has code that looks like this;

Code: Select all

{if $dategroup.is_sticky}
If it does, then immediately after this, but before the {else}, is where your template is adding the date. Simply remove that or change it. If you're not sure about doing this then please post the code snippet in your entries.tpl, just the few lines before and after this, and let us know which template ou're using, and we'll help you rewrite the code to suit your needs.

Cheers, Carl
hudson-valley-dad
Regular
Posts: 40
Joined: Sun Feb 18, 2007 3:11 am

Post by hudson-valley-dad »

Carl,
Thanks for your response. The template I am using is youngbutstrong
Unfortunately there is no code about date and sticky. This is what is at the top:

{serendipity_hookPlugin hook="entries_header" addData="$entry_id"}
{foreach from=$entries item="dategroup"}
{foreach from=$dategroup.entries item="entry"}


Thanks!
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway »

Mmmm, just looking at that template now and it appears the author hasn't provided separate code for sticky pages. Here's what you need to do,

Where you see the following in entries.tpl,

Code: Select all

<div class="content_month">{$entry.timestamp|formatTime:"%b"}</div>
change it to look like this,

Code: Select all

<div class="content_month">
{if $dategroup.is_sticky}{$CONST.STICKY_POSTINGS}{else}
{$entry.timestamp|formatTime:"%b"}{/if}
</div>
That will add the default text for a sticky entry for your language, of course if you would prefer to leave this blank then leave out the {$CONST.STICKY_POSTINGS}

Hope that helps

Carl
hudson-valley-dad
Regular
Posts: 40
Joined: Sun Feb 18, 2007 3:11 am

Post by hudson-valley-dad »

Unfortunately all that did was change the look of the calendar.

Maybe I am not understanding how sticky's work because this is looking just like any other post. It is pushing a category description (since I don't have one assigned it says "Uncategorized " which I certainly don't want.


Here is the url: robertsilichmd . com / plasticsurgeryblog/
(without the spaces) any ideas very helpful
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway »

My apologies, I haven't used that template before so unfortunately gave you bad advice. Looking at the site in question I can see the mistake I made, and I think I understand better what you are looking for now. Am I right in thinking you want the sticky entry to look different somehow from a regular entry?

To remove the little blue box from the left of the sticky entry try altering the code I originally gave you with this;

{if $dategroup.is_sticky}
<div class="content_date" style="background:none;width:0px;"> </div>
{else}
<div class="content_date">
<div class="content_month">{$entry.timestamp|formatTime:"%b"}</div>
{$entry.timestamp|formatTime:"%d"}</div>
{/if}

This should remove the blue box altogether, the next step is to remove the category which means adding some extra code further down in entries.tpl.

If you look at the code you should see an {if} statement with a {foreach} inside it which inserts the category name, but a little further down the word "uncategorized" is typed. The quickest way to remove the uncategorized word is to delete it from the entries.tpl, but you will still be left with the comment icon. Not sure how much of a problem this is for you, and it should be possible to rewrite your entries.tpl to remove this altogether for sticky entries.

Hope this helps you better,

Carl
hudson-valley-dad
Regular
Posts: 40
Joined: Sun Feb 18, 2007 3:11 am

Post by hudson-valley-dad »

Nope that only stripped out the text of the date but still left the box and the date.

Anyone else have a suggestion??
Post Reply