• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: [Gelöst] News Summary Custom Field
PostPosted: Wed Feb 03, 2010 12:54 pm 
Offline
Forum Members
Forum Members
User avatar

Joined: Thu Jan 31, 2008 9:23 am
Posts: 231
Hi,

ich möchte in einem summarytemplate mein custom field anzeigen. Aber leider funktioniert es nicht, mache ich was falsch? Geht es generell nicht? Habe ich ein Brett vorm Kopf?

Mein Versuch:
Code:
{if $entry->Teaser_Image}
   <img src="{$entry->file_location}/{$field->value}" />
   <img src="{$entry->file_location}/{$field->Teaser_Image}" />
{/if}


Aber die If-Abfrage feuert nicht einmal. Was denn da los?!

Gruß
anti


Last edited by antiheld2000 on Tue Feb 09, 2010 7:44 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: News Summary Custom Field
PostPosted: Thu Feb 04, 2010 12:05 am 
antiheld2000 wrote:
{if $entry->Teaser_Image}


{/if}


Ohne jetzt groß auszuprobieren... schau Dir mal die fett markeirten Teile an.
Fällt Dir was auf?


Top
  
 
 Post subject: Re: News Summary Custom Field
PostPosted: Thu Feb 04, 2010 7:19 am 
Offline
Forum Members
Forum Members
User avatar

Joined: Thu Jan 31, 2008 9:23 am
Posts: 231
da hst du recht. das ist schon mal ein guter hinweis ;o) aaaaaaaaaaber dann müsste doch eigentlich das hier klappen, oder nicht?!
Code:
{if isset($entry->fields)}
  {foreach from=$entry->fields item='field'}
     <div class="NewsSummaryField">
        {if $field->type == 'file'}
          <img src="{$entry->file_location}/{$field->value}"/>
        {else}
          {$field->name}: {eval var=$field->value}
        {/if}
     </div>
  {/foreach}
{/if}
Das ist übrigens der Code aus dem Sample Summary template. Warum funktioniert das denn bloss nicht!?!?


Top
 Profile  
 
 Post subject: Re: News Summary Custom Field
PostPosted: Thu Feb 04, 2010 7:49 am 
{$entry->Teaser_Image} ist aber vorhanden und wird angezeigt?


Top
  
 
 Post subject: Re: News Summary Custom Field
PostPosted: Thu Feb 04, 2010 7:53 am 
Offline
Forum Members
Forum Members
User avatar

Joined: Thu Jan 31, 2008 9:23 am
Posts: 231
Im Admin ist es vorhanden, wird dort auch wieder befüllt angezeigt. Im Frontend komme ich da aber irgendwie nicht ran… Dies passiert mit jedem Custom Field. Auch in der Detailansicht, fällt mir just gerade jetzt auf. Hm, sehr seltsam…


Top
 Profile  
 
 Post subject: Re: News Summary Custom Field
PostPosted: Thu Feb 04, 2010 7:56 am 
{get_template_vars} ins template packen und du bekommst angezeigt, was da vorhanden ist ...


Top
  
 
 Post subject: Re: News Summary Custom Field
PostPosted: Thu Feb 04, 2010 8:06 am 
Offline
Forum Members
Forum Members
User avatar

Joined: Thu Jan 31, 2008 9:23 am
Posts: 231
dann brauch ich jetzt nochmal hilfe… ich kann da nichts aufschlussreiches erkennen. was sollte ich hier erkennen können? bitte klär mich auf :)
Code:
SCRIPT_NAME = /index.php
app_name = CMS
sitename = Localhost
lang = de_DE
encoding = utf-8
gCms = Object
cgsimple = Object
content_obj = Object
content_id = 15
page = 15
page_id = 15
page_name = startseite
page_alias = startseite
position = 00001
friendly_position = 1
gcb_params = Array (1)
menuparams = Array (4)
count = 34
nodelist = Array (34)
node = Object
count_value = 6
actionid = m235eb
actionparams = Array (5)
returnid = 15
mod = Object
CompanyDirectory = Object
items = Array (4)
itemcount = 4
pagetext = Seite
oftext = von
pagecount = 1
curpage = 1
firstlink = <<
prevlink = <
lastlink = >>
nextlink = >
entry = Object
firstletter = W
aktletter = W
prevpage = ‹
firstpage = «
nextpage = ›
lastpage = »
pagenumber = 1
category_label = Kategorie:
author_label = Erstellt von:
param_category = Aktuelles
param_summarytemplate = Full-Size-Accordion
param_module = News


Top
 Profile  
 
 Post subject: Re: News Summary Custom Field
PostPosted: Thu Feb 04, 2010 8:10 am 
Wie gesagt, jetzt siehst du erst mal alle Variablen, die Smarty-seitig vorhanden sind, und kannst ins Detail gehen mit

{$entry|print_r}


Top
  
 
 Post subject: Re: News Summary Custom Field
PostPosted: Thu Feb 04, 2010 8:26 am 
Offline
Forum Members
Forum Members
User avatar

Joined: Thu Jan 31, 2008 9:23 am
Posts: 231
Nochmal daaanke, nun ist das Ergebnis wie folgt:
Code:
stdClass Object
(
    [author_id] => 1
    [author] => admin
    [authorname] => 
    [id] => 12
    [title] => News de luxe
    [content] => Lorem Ipsum
    [summary] => Lorem Ipsum
    [postdate] => 2010-02-03 13:14:23
    [startdate] => 2010-02-03 13:14:23
    [enddate] =>
    [create_date] => 2010-02-03 13:15:56
    [modified_date] => 2010-02-03 13:50:17
    [category] => Aktuelles
    [fieldsbyname] => Array
        (
        )

    [fields] => Array
        (
        )

    [file_location] => http://localhost:8888/uploads/news/id12
    [link] => http://localhost:8888/index.php?mact=News,cntnt01,detail,0&cntnt01articleid=12&cntnt01returnid=15
    [titlelink] => Newsde luxe
    [morelink] => Weiterlesen …
    [moreurl] => http://localhost:8888/index.php?mact=News,cntnt01,detail,0&cntnt01articleid=12&cntnt01returnid=15
    [printlink] => Drucken
    [printurl] => http://localhost:8888/index.php?mact=News,cntnt01,print,0&cntnt01articleid=12&cntnt01showtemplate=false&cntnt01returnid=15
)
1


Um es jetzt wirklich zu überprüfen, müsste ich doch die Arrays fieldsbyname und fields augegeben haben. Komm ich so an die ran?!


Top
 Profile  
 
 Post subject: Re: News Summary Custom Field
PostPosted: Thu Feb 04, 2010 8:39 am 
Was mir gerade noch einfällt, CMSms bringt für diesen Check einen eigenen Tag mit

{dump item=$entry}


Top
  
 
 Post subject: Re: News Summary Custom Field
PostPosted: Thu Feb 04, 2010 9:26 am 
Offline
Forum Members
Forum Members
User avatar

Joined: Thu Jan 31, 2008 9:23 am
Posts: 231
Mit {dump wird das nichts...
{dump item=$entry} -> Rendern der Seite bricht ab
{dump item='$entry'} -> $entry = NULL


Top
 Profile  
 
 Post subject: Re: News Summary Custom Field
PostPosted: Thu Feb 04, 2010 9:27 am 
Offline
Forum Members
Forum Members
User avatar

Joined: Thu Jan 31, 2008 9:23 am
Posts: 231
Ähem, ich sehe gerade meine letzten beiden Posts hier nicht mehr?! Ich glaub ich werd verrückt?!?


Top
 Profile  
 
 Post subject: Re: News Summary Custom Field
PostPosted: Thu Feb 04, 2010 9:28 am 
Offline
Forum Members
Forum Members
User avatar

Joined: Thu Jan 31, 2008 9:23 am
Posts: 231
Sorry, wenn das hier jetzt ein doppelpost wird, aber ich kann meine eigenen posts nicht mehr sehen?!

Nochmal daaanke, nun ist das Ergebnis wie folgt:
Code:
stdClass Object
(
    [author_id] => 1
    [author] => admin
    [authorname] => 
    [id] => 12
    [title] => News de luxe
    [content] => Lorem Ipsum
    [summary] => Lorem Ipsum
    [postdate] => 2010-02-03 13:14:23
    [startdate] => 2010-02-03 13:14:23
    [enddate] =>
    [create_date] => 2010-02-03 13:15:56
    [modified_date] => 2010-02-03 13:50:17
    [category] => Aktuelles
    [fieldsbyname] => Array
        (
        )

    [fields] => Array
        (
        )

    [file_location] => http://localhost:8888/uploads/news/id12
    [link] => http://localhost:8888/index.php?mact=News,cntnt01,detail,0&cntnt01articleid=12&cntnt01returnid=15
    [titlelink] => Newsde luxe
    [morelink] => Weiterlesen …
    [moreurl] => http://localhost:8888/index.php?mact=News,cntnt01,detail,0&cntnt01articleid=12&cntnt01returnid=15
    [printlink] => Drucken
    [printurl] => http://localhost:8888/index.php?mact=News,cntnt01,print,0&cntnt01articleid=12&cntnt01showtemplate=false&cntnt01returnid=15
)
1


Um es jetzt wirklich zu überprüfen, müsste ich doch die Arrays fieldsbyname und fields augegeben haben. Komm ich so an die ran?!


Top
 Profile  
 
 Post subject: Re: News Summary Custom Field
PostPosted: Thu Feb 04, 2010 11:22 am 
Ja, der SMF-Spamfilter ist nicht gerade der Hit :( ... seltsamerweise hab ich deine Postings über die Thread-Benachrichtigung lesen können.

Hast du schon mal dies gecheckt?

Code:
{if $entry->fields->Teaser_Image}
   <img src="{$entry->file_location}/{$field->value}" />
   <img src="{$entry->file_location}/{$field->Teaser_Image}" />
{/if}


($entry ist ein Objekt)


Top
  
 
 Post subject: Re: News Summary Custom Field
PostPosted: Thu Feb 04, 2010 1:52 pm 
Offline
Forum Members
Forum Members
User avatar

Joined: Thu Jan 31, 2008 9:23 am
Posts: 231
Ebenfalls kein positives Ergebnis… Sehr seltsam…


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Arvixe - A CMSMS Partner