CMS-Seite via Snippet anzeigen

hallo, ich möchte das CMS-Seite via Snippet anzeigen werde…In CMS-Seiten habe eine neue seite gemacht, sie heißt Wie Lokta Papier drucken, Wahlt keine ordner und druckt Snippet, dann in tpl/page/details/inc, auf der Datei tabs.tpl in Ingendwo, aber ausßere die Block, schreibe,

 [{ oxcontent ident=234ffgt20335d164d004f2sdd34 }]

und die seite zeigt,

hsbx hqwdeewhdn ist was ich in CMS in der Text geschriebe habe…

Meine frage…, warum nicht bekommt Wie Lokta Papier drucken, die ist Titel die ich gegeben habe…was soll ich mache und Wie Lokta Papier drucken neben Zahlung und Lieferung zu bekomme ?

[{oxifcontent ident="ident_id" object="oCont"}]
[{$oCont->oxcontents__oxtitle->value}]
[{$oCont->oxcontents__oxcontent->value}]
[{/oxifcontent}]

Viel danke für deine antwort!

als ich nicht viel erfahrung habe, versuche ich verändert was auf das Erste Block gibt, mit den Parameter die du mir gegeben hast…

[{block name="how_print_lokta"}]
[{oxifcontent ident="9d19a20335d164d004f26292759245b9"}]
    [{assign var="oLongdesc" value=$oDetailsProduct->getLongDescription()}]
    [{if $oLongdesc->value}]
        [{capture append="tabs"}]<a class="nav-link[{if $blFirstTab}] active[{/if}]" href="#description" data-toggle="tab">[{oxmultilang ident="DESCRIPTION"}]</a>[{/capture}]
        [{capture append="tabsContent"}]
            <div id="description" class="tab-pane[{if $blFirstTab}] active[{/if}]" itemprop="description">
                [{oxeval var=$oLongdesc}]
                [{if $oCont->oxcontents__oxcontent->value}]
                    <a id="productExturl" class="js-external" href="[{$oCont->oxcontents__oxcontent->value}]">
                    [{if $oCont->oxcontents__oxcontent->value}]
                        [{$oCont->oxcontents__oxcontent->value}]
                    [{else}]
                        [{$oCont->oxcontents__oxcontent->value}]
                    [{/if}]
                    </a>
                [{/if}]
               
            </div>
        [{/capture}]
        [{assign var="blFirstTab" value=false}]
    [{/if}]
[{/oxhasrights}]
[{/block}]

aber bekomme fehler…kannst du bitte mir sage, um diesen veränderung gut zu machen ?

Falsch:
[{oxifcontent ident="9d19a20335d164d004f26292759245b9" object="oCont"}]

[{/oxifcontent}]

jetzt versuche mit diesen Code, aber bekomme noch fehler…

[{block name="how_print_lokta"}]
[{oxhasrights ident="SHOWLONGDESCRIPTION"}]
   [{oxifcontent ident="9d19a20335d164d004f26292759245b9" object="oCont"}]   
    [{assign var="oCont" value=$oCont->oxcontents__oxcontent()}]
    [{if $oCont->value}]
        [{capture append="tabs"}]<a class="nav-link[{if $blFirstTab}] active[{/if}]" href="#description" data-toggle="tab">[{oxmultilang ident="DESCRIPTION"}]</a>[{/capture}]
        [{capture append="tabsContent"}]
            <div id="description" class="tab-pane[{if $blFirstTab}] active[{/if}]" itemprop="description">
                [{oxeval var=$oCont}]
                [{if $oDetailsProduct->oxarticles__oxexturl->value}]
                    <a id="productExturl" class="js-external" href="[{$oDetailsProduct->oxarticles__oxexturl->value}]">
                    [{if $oDetailsProduct->oxarticles__oxurldesc->value}]
                        [{$oDetailsProduct->oxarticles__oxurldesc->value}]
                    [{else}]
                        [{$oDetailsProduct->oxarticles__oxexturl->value}]
                    [{/if}]
                    </a>
                [{/if}]
               
            </div>
        [{/capture}]
        [{assign var="blFirstTab" value=false}]
    [{/if}]
  [{/oxifcontent}]
[{/oxhasrights}]
[{/block}]

Kein Wunder. Bitte korrigieren. Wie es aussehen soll, steht alles hier im Forum.
falsch [{assign var=“oCont” value=$oCont->oxcontents__oxcontent()}]
falsch [ [{if $oCont->value}]
falsch [{oxeval var=$oCont}]

Kein Wunder. Bitte korrigieren. Wie es aussehen soll, steht alles hier im Forum.

ist was ich mache auch

falsch [{assign var=“oCont” value=$oCont->oxcontents__oxcontent()}]

ich habe Enable debug in 1, und sagt was du sagst oxcontents_oxcontent existieren nicht…

Beispiel, hier wird geruft einen Function, aber was soll hier schreibe ?

Natürlich existiert das nicht. Dazu müsste eine Methode “oxcontents__oxcontent()” vorhanden sein.
Das steht auch nicht oben:
`

$oCont->oxcontents__oxcontent->value

`

kannst du bitte erklärt mit einfacher worten die schritte die ich muss machen um diese Probleme zu losen?

wir jetzt ich habe

[{block name="lokta_schreibe"}]
[{oxhasrights ident="SHOWLONGDESCRIPTION"}]
   [{assign var="hope" value="9d19a20335d164d004f26292759245b9"}]
     [{oxifcontent ident="9d19a20335d164d004f26292759245b9" object="oCont"}]
     
       
       [{if $oCont->oxcontents__oxtitle->value}]
        [{capture append="tabs"}]<a class="nav-link[{if $blFirstTab}] active[{/if}]" href="9d19a20335d164d004f26292759245b9" data-toggle="tab">[{oxmultilang ident="DESCRIPTION"}]</a>[{/capture}]    
        [{capture append="tabsContent"}]
            <div id="description" class="tab-pane[{if $blFirstTab}] active[{/if}]" itemprop="description">
                [{oxeval var=$hope}]
                [{if $oDetailsProduct->oxarticles__oxexturl->value}]
                    <a id="productExturl" class="js-external" href="[{$oDetailsProduct->oxarticles__oxexturl->value}]">
                    [{if $oDetailsProduct->oxarticles__oxurldesc->value}]
                        [{$oDetailsProduct->oxarticles__oxurldesc->value}]
                    [{else}]
                        [{$oDetailsProduct->oxarticles__oxexturl->value}]
                    [{/if}]
                    </a>
                [{/if}]
               
            </div>
        [{/capture}]
      [{/if}]
[{/oxifcontent}]
[{/oxhasrights}]
[{/block}]

Da dürfte ja zumindest schonmal kein Smarty-Fehler mehr auftauchen.
Fehler:

Siehe tabs.tpl

jetzt habe wie du sagst,

[{capture append="tabs"}]<a class="nav-link[{if $blFirstTab}] active[{/if}]" href="9d19a20335d164d004f26292759245b9" id="description" data-toggle="tab">[{oxmultilang ident="DESCRIPTION"}]</a>[{/capture}] 

die rest code habe wie meine letzte post…
aber bekomme zwei mal Beschreibung und nicht die tabelle von Wie Lokta Papier drucken

Das ist doch klar, weil da nix geändert wurde.

Um es abzukürzen:

[{block name="lokta_schreibe"}]
[{oxhasrights ident="SHOWLONGDESCRIPTION"}]
   [{assign var="hope" value="9d19a20335d164d004f26292759245b9"}]
     [{oxifcontent ident="9d19a20335d164d004f26292759245b9" object="oCont"}]
     
       
       [{if $oCont->oxcontents__oxtitle->value}]
        [{capture append="tabs"}]<a class="nav-link[{if $blFirstTab}] active[{/if}]" href="#joseba" data-toggle="tab">[{$oCont->oxcontents__oxtitle->value}]</a>[{/capture}]    
        [{capture append="tabsContent"}]
            <div id="joseba" class="tab-pane[{if $blFirstTab}] active[{/if}]" itemprop="joseba">
                [{oxeval var=$hope}]
                [{if $oDetailsProduct->oxarticles__oxexturl->value}]
                    <a id="productExturl" class="js-external" href="[{$oDetailsProduct->oxarticles__oxexturl->value}]">
                    [{if $oDetailsProduct->oxarticles__oxurldesc->value}]
                        [{$oDetailsProduct->oxarticles__oxurldesc->value}]
                    [{else}]
                        [{$oDetailsProduct->oxarticles__oxexturl->value}]
                    [{/if}]
                    </a>
                [{/if}]
               
            </div>
        [{/capture}]
		[{assign var="blFirstTab" value=false}]
      [{/if}]
[{/oxifcontent}]
[{/oxhasrights}]
[{/block}]
1 Like

danke !, mit deiner veränderung und ich etwas gemacht habe, bekomme alles wie ich möchtet …

Der Code,

[{block name="lokta_schreibe"}]
 [{oxhasrights ident="SHOWLONGDESCRIPTION"}]
   [{oxifcontent ident="9d19a20335d164d004f26292759245b9" object="oCont"}]
   [{assign var="hope" value=$oCont->oxcontents__oxcontent->value}]
   [{if $oCont->oxcontents__oxtitle->value}]
     [{capture append="tabs"}]<a class="nav-link[{if $blFirstTab}] active[{/if}]" href="#joseba" data-toggle="tab">[{$oCont->oxcontents__oxtitle->value}]</a>[{/capture}]    
    [{capture append="tabsContent"}]
        <div id="joseba" class="tab-pane[{if $blFirstTab}] active[{/if}]" itemprop="joseba">
            [{oxeval var=$hope }]
            [{if $oDetailsProduct->oxarticles__oxexturl->value}]
                <a id="productExturl" class="js-external" href="  [{$oDetailsProduct->oxarticles__oxexturl->value}]">
                [{if $oDetailsProduct->oxarticles__oxurldesc->value}]
                    [{$oDetailsProduct->oxarticles__oxurldesc->value}]
                [{else}]
                    [{$oDetailsProduct->oxarticles__oxexturl->value}]
                [{/if}]
                </a>
            [{/if}]
           
        </div>
    [{/capture}]
	[{assign var="blFirstTab" value=false}]
  [{/if}]
  [{/oxifcontent}]
  [{/oxhasrights}]
 [{/block}]

Eine frage…wie kann mache dass die tabelle nur wird in bestimmtes Seite gezeigt ?

Block einbetten in z.B.

[{if $oDetailsProduct->oxarticles__oxartnum->value == “12345”}]
[{block name=“lokta_schreibe”}]

[{/block}]
[{/if}]

1 Like

danke, aber habe geschribe wie du meint,

[{if $oDetailsProduct->oxarticles__oxartnum->value == "12345"}]
[{block name="lokta_schreibe"}]
  [{oxhasrights ident="SHOWLONGDESCRIPTION"}]
    .
    .
    .

in der tabs.tpl datei aber die tabelle ist verschwinden…

Ähhhh. Im Besipiel erscheint der Tab nur bei einer bestimmten Artikelnummer. 12345 must schon anpassen.

Etwas anderes als Artikelinfos (Artikelnummer oder ID oder vielleicht die Kategorie) abzufragen, macht hier keinen Sinn,

Ende Gelände :wink:

@ rubbercut keine probleme, Vielleicht andere möchte mir helfe…

Mit [{if $oDetailsProduct->oxarticles__oxartnum->value == "12345"}], bekommt die moglichkeit das nur eine seite wird gezeigt, aber ich möchte noch 4…, ich versuche mit

$hallo =  array("12345", "4321123", "53422", "97654");
if(in_array($oDetailsProduct->oxarticles__oxartnum->value, $hallo))}]
[{block name="lokta_schreibe"}]
[{oxhasrights ident="SHOWLONGDESCRIPTION"}]
.
.
. 

aber bekommt fehler…

Das geht so nicht. Entweder nur smarty (Vers. 2):

[{capture append=“hallo”}]12345[{/capture}]
[{capture append=“hallo”}]4321123[{/capture}]
[{capture append=“hallo”}]53422[{/capture}]
[{capture append=“hallo”}]97654[{/capture}]
[{if in_array($oDetailsProduct->oxarticles__oxartnum->value, $hallo)}]

oder php entsprechend der Vorgaben: php | Smarty

[{php}]
$hallo = array(“12345”, “4321123”, “53422”, “97654”);
$this->assign(“hallo”, $hallo);
[{/php}]
[{if in_array($oDetailsProduct->oxarticles__oxartnum->value, $hallo)}]

einbinden.

Tomaten züchten ist einfacher :wink:

1 Like

Viel danke für deine bemüht um du mir zu helfe!

Wie deine Code jetzt ich habe,

[{php}]
 $hallo = array('205001', '205001-1', '205001-2', '205001-3');
 $this->assign(“hallo”, $hallo);
[{/php}]
[{if (in_array($oDetailsProduct->oxarticles__oxartnum->value, $hallo))}]
[{block name="lokta_schreibe"}]
 [{oxhasrights ident="SHOWLONGDESCRIPTION"}]
   [{oxifcontent ident="9d19a20335d164d004f26292759245b9" object="oCont"}]
     [{assign var="hope" value=$oCont->oxcontents__oxcontent->value}]
     [{if $oCont->oxcontents__oxtitle->value}]
        [{capture append="tabs"}]<a class="nav-link[{if $blFirstTab}] active[{/if}]" href="#joseba" data-toggle="tab">[{$oCont->oxcontents__oxtitle->value}]</a>[{/capture}]    
         [{capture append="tabsContent"}]
           <div id="joseba" class="tab-pane[{if $blFirstTab}] active[{/if}]" itemprop="joseba">
             [{oxeval var=$hope }]
             [{if $oDetailsProduct->oxarticles__oxexturl->value}]
                <a id="productExturl" class="js-external" href="[{$oDetailsProduct->oxarticles__oxexturl->value}]">
                [{if $oDetailsProduct->oxarticles__oxurldesc->value}]
                    [{$oDetailsProduct->oxarticles__oxurldesc->value}]
                [{else}]
                    [{$oDetailsProduct->oxarticles__oxexturl->value}]
                [{/if}]
                </a>
             [{/if}]
           </div>
      [{/capture}]
	  [{assign var="blFirstTab" value=false}]
   [{/if}]
  [{/oxifcontent}]
[{/oxhasrights}]
[{/block}]
[{/if}]

aber bekommt dieser warnung,

Warning : in_array() expects parameter 2 to be array, null given in /var/www/html/oxid/source/tmp/smarty/147c42bfd77af53c89df35f918f06a4d^%%F5^F50^F500F10E%%tabs.tpl.php on line 42

Auf der Zeile 42 habe [{oxeval var=$hope }]