News module: How to include "formatpostdate" in "Summary"?
News module: How to include "formatpostdate" in "Summary"?
Hello!
I would like to include the formatpostdate in the same paragraph as the summary. How do I do this? I also want to edit the formatpostdate so it looks like "(T&M 2007-05-14) instead of just "2007-05-14". How do I go about fixing that?
Regards
J
I would like to include the formatpostdate in the same paragraph as the summary. How do I do this? I also want to edit the formatpostdate so it looks like "(T&M 2007-05-14) instead of just "2007-05-14". How do I go about fixing that?
Regards
J
Re: News module: How to include "formatpostdate" in "Summary"?
I am not understanding something very basic here since no one is replying?
Anyone??
J

Anyone??
J
Re: News module: How to include "formatpostdate" in "Summary"?
In Content -> News -> Summary template:Joppjopp wrote: Hello!
I would like to include the formatpostdate in the same paragraph as the summary. How do I do this? I also want to edit the formatpostdate so it looks like "(T&M 2007-05-14) instead of just "2007-05-14". How do I go about fixing that?
Delete postdate section:
Code: Select all
{if $entry->formatpostdate}
<div class="NewsSummaryPostdate">
{$entry->formatpostdate}
</div>
{/if}
Code: Select all
{if $entry->summary}
<div class="NewsSummarySummary">
{eval var=$entry->summary}
</div>
<div class="NewsSummaryMorelink">
[{$entry->morelink}]
</div>
{/if}
Code: Select all
{if $entry->summary}
<div class="NewsSummarySummary">
{$entry->formatpostdate}
{eval var=$entry->summary}
</div>
<div class="NewsSummaryMorelink">
[{$entry->morelink}]
</div>
{/if}
{news [other param from help] dateformat="(T&M %Y-%m-%d)"}
Alby
Re: News module: How to include "formatpostdate" in "Summary"?
Thanks! The above helped. But getting the formatpostdate in the end of the summary is still not working. I want it like this:alby wrote:
Call module:
{news [other param from help] dateformat="(T&M %Y-%m-%d)"}
Alby

Alby, your examples lets me move the formatpostdate around, but it still won't join the text in the summary.
J
Last edited by Joppjopp on Tue May 15, 2007 10:02 pm, edited 1 time in total.
Re: News module: How to include "formatpostdate" in "Summary"?
My test with:Joppjopp wrote:Jalby wrote:
Call module:
{news [other param from help] dateformat="(T&M %Y-%m-%d)"}
Alby
{cms_module module="news" number="2" category="Home" dateformat="(T&M %Y-%m-%d)" moretext="dettaglio..."}
and
Code: Select all
{if $entry->summary}
<div class="NewsSummarySummary">
{eval var=$entry->summary}
{$entry->formatpostdate}
</div>
<div class="NewsSummaryMorelink">
[{$entry->morelink}]
</div>
{else if $entry->content}
<div class="NewsSummaryContent">
{eval var=$entry->content}
</div>
{/if}
Alby
[gelöscht durch Administrator]
Re: News module: How to include "formatpostdate" in "Summary"?
Hi Alby. Thanks for all the help. It's still not working though I copied and pasted your code. My summary template looks like this:
But my output looks like this:

Could it be something in the CSS?
I am scratching my head. Not only is the date not added just after the word "styrelse", but both the date and the link are on the edge of the page, while they should be lining up with paragraph above...
Code: Select all
<!-- Start News Display Template -->
{foreach from=$items item=entry}
<div class="NewsSummary">
<div class="NewsSummaryTitle">
{$entry->title}
</div>
{if $entry->summary}
<div class="NewsSummarySummary">
{eval var=$entry->summary}
{$entry->formatpostdate}
</div>
<div class="NewsSummaryMorelink">
[{$entry->morelink}]
</div>
{else if $entry->content}
<div class="NewsSummaryContent">
{eval var=$entry->content}
</div>
{/if}
</div>
{/foreach}
<!-- End News Display Template -->

Could it be something in the CSS?
Code: Select all
.NewsSummarySummary {
font-family: "Verdana", sans-serif;
font-size: 95%;
line-height: 1.5em;
color: #4A4A4A;
}
Re: News module: How to include "formatpostdate" in "Summary"?
Look to html source page.Joppjopp wrote:
But my output looks like this:
Could it be something in the CSS?I am scratching my head. Not only is the date not added just after the word "styrelse", but both the date and the link are on the edge of the page, while they should be lining up with paragraph above...Code: Select all
.NewsSummarySummary { font-family: "Verdana", sans-serif; font-size: 95%; line-height: 1.5em; color: #4A4A4A; }
The problem, probably, is a paragraph of summary, ex:
Code: Select all
<div class="NewsSummarySummary">
<p>summary text</p>
(T&M 2007-05-21)
</div>
and change (for link):
Code: Select all
{if $entry->summary}
<div class="NewsSummarySummary">
{eval var=$entry->summary}
{$entry->formatpostdate}
[{$entry->morelink}]
</div>
{else if $entry->content}
<div class="NewsSummaryContent">
{eval var=$entry->content}
</div>
{/if}
Last edited by alby on Wed May 16, 2007 8:04 pm, edited 1 time in total.
Re: News module: How to include "formatpostdate" in "Summary"?
Where would I look to find the HTML? (Or did I miss something here?)alby wrote:
Look to html source page.
The problem, probably, is a paragraph of summary, ex:Try to drop html tag from summary with html source button in your WYSIWYG or select "none" in WYSIWYG field (User Preference)Code: Select all
<div class="NewsSummarySummary"> <p>summary text</p> (T&M 2007-05-21) </div>
Jesper
Re: News module: How to include "formatpostdate" in "Summary"?
Your browser: View page source or View HTMLJoppjopp wrote:Where would I look to find the HTML? (Or did I miss something here?)alby wrote: Look to html source page.
The problem, probably, is a paragraph of summary, ex:Code: Select all
<div class="NewsSummarySummary"> <p>summary text</p> (T&M 2007-05-21) </div>
Alby
Re: News module: How to include "formatpostdate" in "Summary"?
Alby, you are right. There's a paragraph of summary. How do I get the date within the paragraph? Sorry to be a such a slowhead...
J
J
Re: News module: How to include "formatpostdate" in "Summary"?
Add date in summary textJoppjopp wrote: Alby, you are right. There's a paragraph of summary. How do I get the date within the paragraph? Sorry to be a such a slowhead...

Ok , for strip html tag (ex. p) in news article summary, you have two method:
1. Summary text only.
If you use TinyMCE, in last version, there is a option for display a button to turn wysiwyg on/off in textarea (in this case summary textarea). Turn off and edit your summary text. Result is text only.
Or, in User preferences, switch to "none" the field: Select WYSIWYG to use (Turn off all WYSIWYG textarea)
2. You know html tag.
In WYSIWYG of summary textarea (FCK or Tiny) there is a button for switch to html source. Strip p starting tag (and relative close tag), ex:
Code: Select all
<p> <----- start tag
qwerty <tag>qwerty</tag> qwerty qwerty qwerty qwerty
qwerty qwerty <tag>qwerty</tag> qwerty qwerty qwerty
</p> <---- end tag
Code: Select all
Find the row:
$this->smarty->assign('inputsummary', $this->CreateTextArea(true, $id, $summary, 'summary', '', '', '', '', '80', '3'));
and substitute with (note #):
$this->smarty->assign('inputsummary', $this->CreateInputText($id, 'summary', $summary, 75, 500));
# $this->smarty->assign('inputsummary', $this->CreateTextArea(true, $id, $summary, 'summary', '', '', '', '', '80', '3'));
Last edited by alby on Fri May 18, 2007 6:58 am, edited 1 time in total.
Re: News module: How to include "formatpostdate" in "Summary"?
Thanks Alby!
I'll try this. Sorry for not getting back to you on this sooner. I have been out of town.
J
I'll try this. Sorry for not getting back to you on this sooner. I have been out of town.
J
Re: News module: How to include "formatpostdate" in "Summary"?
Hi Alby!alby wrote:Add date in summary textJoppjopp wrote: Alby, you are right. There's a paragraph of summary. How do I get the date within the paragraph? Sorry to be a such a slowhead...
Ok , for strip html tag (ex. p) in news article summary, you have two method:
1. Summary text only.
If you use TinyMCE, in last version, there is a option for display a button to turn wysiwyg on/off in textarea (in this case summary textarea). Turn off and edit your summary text. Result is text only.
Or, in User preferences, switch to "none" the field: Select WYSIWYG to use (Turn off all WYSIWYG textarea)
2. You know html tag.
In WYSIWYG of summary textarea (FCK or Tiny) there is a button for switch to html source. Strip p starting tag (and relative close tag), ex:Or hack action.editaricle.php (transform summary textarea in inputtext):Code: Select all
<p> <----- start tag qwerty <tag>qwerty</tag> qwerty qwerty qwerty qwerty qwerty qwerty <tag>qwerty</tag> qwerty qwerty qwerty </p> <---- end tag
AlbyCode: Select all
Find the row: $this->smarty->assign('inputsummary', $this->CreateTextArea(true, $id, $summary, 'summary', '', '', '', '', '80', '3')); and substitute with (note #): $this->smarty->assign('inputsummary', $this->CreateInputText($id, 'summary', $summary, 75, 500)); # $this->smarty->assign('inputsummary', $this->CreateTextArea(true, $id, $summary, 'summary', '', '', '', '', '80', '3'));
I had to pause the project for a few months but now I am on it again. I've just tried what you suggest in the post above but it's not helping. If I erase the and it just looks like this (everything ends up in the marginal):

If I edit the code like you suggested nothing happens (that I can see anyway).

Any more ideas?
Jesper
Re: News module: How to include "formatpostdate" in "Summary"?
Then you need to add padding to div...