wie mach ich das denn?

Hier können Probleme und alles andere in Deutscher Sprache gelöst werden.
Col. Kurtz
Regular
Posts: 450
Joined: Thu May 26, 2005 10:43 am
Location: Bonn, Germany
Contact:

wie mach ich das denn?

Post by Col. Kurtz » Wed Oct 10, 2007 10:42 pm

-ok ich möchte das nautica05b theme nutzen welches ich bei oswd.org gefunden habe (link)

nun wird da das datum speziell dargestellt und zwar werden monat und tag getrennt ausgegeben:

Code: Select all

<div class="post">

        <div class="date">
          <span class="month">May</span>
          <span class="day">14</span>
        </div>

        <p>
          <span class="title">Title</span>
      Eintrag
      </div>


Ist es möglich die entries.tpl entsprechendumzubauen dass man das auch so ausgeben kann? HTML und CSS kann ich leidlich, Smarty aber nicht.

Dank für Eure Hilfe
Marc

mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 9:35 pm
Location: Wiesbaden, Germany
Contact:

Post by mattsches » Wed Oct 10, 2007 11:59 pm

Klar geht das, probier mal folgendes:

Code: Select all

{$dategroup.date|@formatTime:%b}
für den Monat und

Code: Select all

{$dategroup.date|@formatTime:%d}
für den Tag. Es sollte also ungefähr so aussehen:

Code: Select all

<div class="post">
    <div class="date">
        <span class="month">{$dategroup.date|@formatTime:%b}</span>
        <span class="day">{$dategroup.date|@formatTime:%d}</span>
    </div>
    ...
</div>
Im Smarty-Handbuch sind die Datumsformatierungen noch ausführlicher dargestellt.

HTH
- Mattsches

Col. Kurtz
Regular
Posts: 450
Joined: Thu May 26, 2005 10:43 am
Location: Bonn, Germany
Contact:

Post by Col. Kurtz » Thu Oct 11, 2007 7:39 am

Danke, so habe ich es hinbekommen, nur die " fehlten bei den Werten.
Marc

Col. Kurtz
Regular
Posts: 450
Joined: Thu May 26, 2005 10:43 am
Location: Bonn, Germany
Contact:

Post by Col. Kurtz » Thu Oct 11, 2007 8:50 am

Das klappt wunderbar solange ich nur einen Eintrag pro Tag habe, gibt es einen zweiten geht mir das Design hops.

Wie kann ich es einstellen daß das Datum jedesmal bei einem Eintrag angezeigt wird, auch wenn an dem Tag schon ein weiterer Eintrag besteht?
Marc

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking » Thu Oct 11, 2007 11:28 am

Hi!

Col. Kurtz wrote:Das klappt wunderbar solange ich nur einen Eintrag pro Tag habe, gibt es einen zweiten geht mir das Design hops.

Wie kann ich es einstellen daß das Datum jedesmal bei einem Eintrag angezeigt wird, auch wenn an dem Tag schon ein weiterer Eintrag besteht?


Da musst Du dann anstelle der $dategroup variable innerhalb der zweiten foreach-Schleife die $entry-Variable für die Ausgabe des Datums nutzen. Dann wird für jeden Eintrag das Datum individuell ausgegeben.

Grüße,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

Col. Kurtz
Regular
Posts: 450
Joined: Thu May 26, 2005 10:43 am
Location: Bonn, Germany
Contact:

Post by Col. Kurtz » Thu Oct 11, 2007 11:35 am

Ja ich hab damit schonmal rumgespielt aber nicht so wirklich erfolg.

Hier ist der Code:

Code: Select all

    {foreach from=$entries item="dategroup"}
   <div class="post">
    <div class="serendipity_Entry_Date">
        {if $dategroup.is_sticky}
        <h3 class="serendipity_date">{$CONST.STICKY_POSTINGS}</h3>
        {else}
       
    <div class="date">
        <span class="month">{$dategroup.date|@formatTime:"%b"}</span>
        <span class="day">{$dategroup.date|@formatTime:"%d"}</span>
    </div>

        {/if}
<p>
        {foreach from=$dategroup.entries item="entry"}
        <span class="title"><a href="{$entry.link}">{$entry.title}</a></span>
   {$entry.body}      <br><br>

.....

</p></div>

....

{foreachelse}
    {if not $plugin_clean_page}
        {$CONST.NO_ENTRIES_TO_PRINT}
    {/if}
    {/foreach}

</div
Marc

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking » Thu Oct 11, 2007 12:56 pm

Hi!

Tiefer, anders:

Code: Select all

    {foreach from=$entries item="dategroup"}
   <div class="post">
    <div class="serendipity_Entry_Date">
<p>
        {foreach from=$dategroup.entries item="entry"}
       
    <div class="date">
        <span class="month">{$entry.date|@formatTime:"%b"}</span>
        <span class="day">{$entry.date|@formatTime:"%d"}</span>
    </div>

        <span class="title"><a href="{$entry.link}">{$entry.title}</a></span>
   {$entry.body}      <br><br>

.....

</p></div>



Grüße,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

Col. Kurtz
Regular
Posts: 450
Joined: Thu May 26, 2005 10:43 am
Location: Bonn, Germany
Contact:

Post by Col. Kurtz » Thu Oct 11, 2007 2:16 pm

ok ich bin einen schritt weiter. jetzt werden die einzelnen daten zusammen angezeigt, ich würde es aber gerne so haben daß wirklich bei jedem eintrag es komplett angezeigt wird.

So soll es sein, auch bei mehreren einträgen am tag:

Image

So ist es im Moment:

Image

und mal wieder mein code:

Code: Select all

{foreach from=$entries item="dategroup"}
   <div class="post">


        {foreach from=$dategroup.entries item="entry"}
      
          <div class="serendipity_Entry_Date">
        {if $dategroup.is_sticky}
        <h3 class="serendipity_date">{$CONST.STICKY_POSTINGS}</h3>
        {else}
       
    <div class="date">
        <span class="month">{$dategroup.date|@formatTime:"%b"}</span>
        <span class="day">{$dategroup.date|@formatTime:"%d"}</span>
    </div>

        {/if}
      <p>
        <span class="title"><a href="{$entry.link}">{$entry.title}</a></span>
   {$entry.body}      <br><br>
Last edited by Col. Kurtz on Thu Oct 11, 2007 2:17 pm, edited 1 time in total.
Marc

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking » Thu Oct 11, 2007 2:17 pm

Hi!

Ja, genau dafür müsste mein gezeigter code sein! Musst einfach die Datumsdarstellung innerhalb des zweiten foreach loops packen.

Grüße,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

Col. Kurtz
Regular
Posts: 450
Joined: Thu May 26, 2005 10:43 am
Location: Bonn, Germany
Contact:

Post by Col. Kurtz » Thu Oct 11, 2007 2:19 pm

hab ich das nicht? wie gesagt dann sieht es so aus wie oben gezeigt.
Marc

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking » Thu Oct 11, 2007 3:09 pm

Hi!

Hm, verstehe nicht wie dein codeschnippsel den im screenshot gezeigten ausschnitt darstellen kann. Dürfte eigentlich nicht sein, das Datum muss pro Eintrag erscheinen, weil es ja da im foreach-Loop ausgegeben wird im gegensatzu zu vorher.

Prüf mal ob dein Code wirklich dem so entspricht was Du hier auszugsweise darstellst?

Grüße,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

Col. Kurtz
Regular
Posts: 450
Joined: Thu May 26, 2005 10:43 am
Location: Bonn, Germany
Contact:

Post by Col. Kurtz » Thu Oct 11, 2007 3:30 pm

hier zu sehen:
http://test.hohle-phrasen.de/serendipity/

code:

Code: Select all

<!-- ENTRIES START -->

    {serendipity_hookPlugin hook="entries_header" addData="$entry_id"}

{foreach from=$entries item="dategroup"}
   <div class="post">


        {foreach from=$dategroup.entries item="entry"}
      
          <div class="serendipity_Entry_Date">
        {if $dategroup.is_sticky}
        <h3 class="serendipity_date">{$CONST.STICKY_POSTINGS}</h3>
        {else}
       
    <div class="date">
        <span class="month">{$dategroup.date|@formatTime:"%b"}</span>
        <span class="day">{$dategroup.date|@formatTime:"%d"}</span>
    </div>

        {/if}
      <p>
        <span class="title"><a href="{$entry.link}">{$entry.title}</a></span>
   {$entry.body}      <br><br>
 
   
                {if $entry.has_comments}
                    {if $use_popups}
                        <a href="{$entry.link_popup_comments}" onclick="window.open(this.href, 'comments', 'width=480,height=480,scrollbars=yes'); return false;">{$entry.label_comments} ({$entry.comments})</a>
                    {else}
                        <a href="{$entry.link}#comments">{$entry.label_comments} ({$entry.comments})</a>
                    {/if}
                {/if}

                {if $entry.is_entry_owner and not $is_preview}
                        | <a href="{$entry.link_edit}">{$CONST.EDIT_ENTRY}</a>
                {/if}

                {$entry.add_footer}


<div class="serendipity_entry serendipity_entry_author_{$entry.author|@makeFilename} {if $entry.is_entry_owner}serendipity_entry_author_self{/if}">
            {if $entry.categories}
            <span class="serendipity_entryIcon">
            {foreach from=$entry.categories item="entry_category"}
                {if $entry_category.category_icon}
                    <a href="{$entry_category.category_link}"><img class="serendipity_entryIcon" title="{$entry_category.category_name|@escape}{$entry_category.category_description|@emptyPrefix}" alt="{$entry_category.category_name|@escape}" src="{$entry_category.category_icon}" /></a>
                {/if}
            {/foreach}
            </span>
            {/if}
         
           
     
</p>
</div>
   


            {if $entry.is_extended}
            <div class="serendipity_entry_extended"><a id="extended"></a>{$entry.extended}</div>
            {/if}

            {if $entry.has_extended and not $is_single_entry and not $entry.is_extended}
            <br /><a href="{$entry.link}#extended">{$CONST.VIEW_EXTENDED_ENTRY|@sprintf:$entry.title}</a><br /><br />
            {/if}

           
        </div>
        <!--
        <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
                 xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
                 xmlns:dc="http://purl.org/dc/elements/1.1/">
        <rdf:Description
                 rdf:about="{$entry.link_rdf}"
                 trackback:ping="{$entry.link_trackback}"
                 dc:title="{$entry.title_rdf|@default:$entry.title}"
                 dc:identifier="{$entry.rdf_ident}" />
        </rdf:RDF>
        -->
        {$entry.plugin_display_dat}

        {if $is_single_entry and not $use_popups and not $is_preview}
            {if $CONST.DATA_UNSUBSCRIBED}
                <br /><div class="serendipity_center serendipity_msg_notice">{$CONST.DATA_UNSUBSCRIBED|@sprintf:$CONST.UNSUBSCRIBE_OK}</div><br />
            {/if}

            {if $CONST.DATA_TRACKBACK_DELETED}
                <br /><div class="serendipity_center serendipity_msg_notice">{$CONST.DATA_TRACKBACK_DELETED|@sprintf:$CONST.TRACKBACK_DELETED}</div><br />
            {/if}

            {if $CONST.DATA_TRACKBACK_APPROVED}
                <br /><div class="serendipity_center serendipity_msg_notice">{$CONST.DATA_TRACKBACK_APPROVED|@sprintf:$CONST.TRACKBACK_APPROVED}</div><br />
            {/if}

            {if $CONST.DATA_COMMENT_DELETED}
                <br /><div class="serendipity_center serendipity_msg_notice">{$CONST.DATA_COMMENT_DELETED|@sprintf:$CONST.COMMENT_DELETED}</div><br />
            {/if}

            {if $CONST.DATA_COMMENT_APPROVED}
                <br /><div class="serendipity_center serendipity_msg_notice">{$CONST.DATA_COMMENT_APPROVED|@sprintf:$CONST.COMMENT_APPROVED}</div><br />
            {/if}

            <div class="serendipity_comments serendipity_section_trackbacks">
                <br />
                <a id="trackbacks"></a>
                <div class="serendipity_commentsTitle">{$CONST.TRACKBACKS}</div>
                    <div class="serendipity_center">
                        <a rel="nofollow" style="font-weight: normal" href="{$entry.link_trackback}" onclick="alert('{$CONST.TRACKBACK_SPECIFIC_ON_CLICK|@escape:html}'); return false;" title="{$CONST.TRACKBACK_SPECIFIC_ON_CLICK|@escape}">{$CONST.TRACKBACK_SPECIFIC}</a>
                    </div>
                    <br />
                        {serendipity_printTrackbacks entry=$entry.id}
            </div>
        {/if}

        {if $is_single_entry and not $is_preview}
            <div class="serendipity_comments serendipity_section_comments">
                <br />
                <a id="comments"></a>
                <div class="serendipity_commentsTitle">{$CONST.COMMENTS}</div>
                <div class="serendipity_center">{$CONST.DISPLAY_COMMENTS_AS}
                {if $entry.viewmode eq $CONST.VIEWMODE_LINEAR}
                    ({$CONST.COMMENTS_VIEWMODE_LINEAR} | <a href="{$entry.link_viewmode_threaded}#comments" rel="nofollow">{$CONST.COMMENTS_VIEWMODE_THREADED}</a>)
                {else}
                    (<a rel="nofollow" href="{$entry.link_viewmode_linear}#comments">{$CONST.COMMENTS_VIEWMODE_LINEAR}</a> | {$CONST.COMMENTS_VIEWMODE_THREADED})
                {/if}
                </div>
                <br />
                    {serendipity_printComments entry=$entry.id mode=$entry.viewmode}

                {if $entry.is_entry_owner}
                    {if $entry.allow_comments}
                    <div class="serendipity_center">(<a href="{$entry.link_deny_comments}">{$CONST.COMMENTS_DISABLE}</a>)</div>
                    {else}
                    <div class="serendipity_center">(<a href="{$entry.link_allow_comments}">{$CONST.COMMENTS_ENABLE}</a>)</div>
                    {/if}
                {/if}
                <a id="feedback"></a>

                {foreach from=$comments_messagestack item="message"}
                <div class="serendipity_center serendipity_msg_important">{$message}</div>
                {/foreach}

                {if $is_comment_added}

                <br />
                <div class="serendipity_center serendipity_msg_notice">{$CONST.COMMENT_ADDED}</div>

                {elseif $is_comment_moderate}

                <br />
                <div class="serendipity_center serendipity_msg_notice">{$CONST.COMMENT_ADDED}<br />{$CONST.THIS_COMMENT_NEEDS_REVIEW}</div>

                {elseif not $entry.allow_comments}

                <br />
                <div class="serendipity_center serendipity_msg_important">{$CONST.COMMENTS_CLOSED}</div>

                {else}

                <br />
                <div class="serendipity_section_commentform">
                   <div class="serendipity_commentsTitle">{$CONST.ADD_COMMENT}</div>
                   {$COMMENTFORM}
            </div>

                {/if}
            </div>
        {/if}

        {$entry.backend_preview}
        {/foreach}
    </div>

    {foreachelse}
    {if not $plugin_clean_page}
        {$CONST.NO_ENTRIES_TO_PRINT}
    {/if}
    {/foreach}
   

    <div class='serendipity_entryFooter' style="text-align: center">
    {if $footer_prev_page}
        <a href="{$footer_prev_page}">&laquo; {$CONST.PREVIOUS_PAGE}</a>  
    {/if}

    {if $footer_info}
        ({$footer_info})
    {/if}

    {if $footer_next_page}
        <a href="{$footer_next_page}">&raquo; {$CONST.NEXT_PAGE}</a>
    {/if}

    {serendipity_hookPlugin hook="entries_footer"}
    </div>
   
<!-- ENTRIES END -->
Marc

Col. Kurtz
Regular
Posts: 450
Joined: Thu May 26, 2005 10:43 am
Location: Bonn, Germany
Contact:

Post by Col. Kurtz » Thu Oct 11, 2007 3:31 pm

und auf meiner localen installation siehts genauso aus
Marc

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking » Thu Oct 11, 2007 3:38 pm

Hi!

Ah! Alles klar. Dein HTML-Code sieht gut aus.

Es ist ein CSS-Problem, scheinbar wird das Datum absolut platziert, so dass Du das Datum zweimal genau übereinander hast. Da musst Du dann noch was hin- und herschieben, möglicherweise musst Du dein wrappendes <div class="post"> anders platzieren?

Viele Grüße,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

Col. Kurtz
Regular
Posts: 450
Joined: Thu May 26, 2005 10:43 am
Location: Bonn, Germany
Contact:

Post by Col. Kurtz » Thu Oct 11, 2007 5:06 pm

garvinhicking wrote:Ah! Alles klar. Dein HTML-Code sieht gut aus.


ist genau genommen ja gar nicht meiner. ich habe nur den eigentlichen code mit dem default template zusammengeschmissen

garvinhicking wrote:Es ist ein CSS-Problem, scheinbar wird das Datum absolut platziert, so dass Du das Datum zweimal genau übereinander hast.


schuldig.

garvinhicking wrote:Da musst Du dann noch was hin- und herschieben, möglicherweise musst Du dein wrappendes <div class="post"> anders platzieren?


ja das hat geholfen. ich habe den code nochmal auseinandergenommen und bin fündig geworden.

danke.
(wenn du mal wieder lust auf nen besuch beim goldenen M zum Mittagessen hast....)
Marc

Post Reply