[gelöst] smarty abfrage?!

Diskussionen zur Smarty-Template-Engine
Locked
nicmare
Power Poster
Power Poster
Posts: 1150
Joined: Sat Aug 25, 2007 9:55 am
Location: Berlin

[gelöst] smarty abfrage?!

Post by nicmare »

ich versuche mich gerade an einer eigentlich simple smarty abfrage. aber ich scheitere. ich möchte sowas in der art machen:

Code: Select all

{assign var=currentpath value=$gCms->config.root_url+$smarty.server.REQUEST_URI} 
{if $one.detail_url == $currentpath}…{/if}
aber das zusammenfügen von den zwei smarty variablen in der ersten Zeile klappt natürlich nicht. wie macht man das?
Last edited by nicmare on Tue Aug 03, 2010 1:04 pm, edited 1 time in total.
nockenfell
Power Poster
Power Poster
Posts: 751
Joined: Fri Sep 12, 2008 2:34 pm
Location: Schweiz / Switzerland

Re: smarty abfrage?!

Post by nockenfell »

Mach das doch mit capture:
http://forum.cmsmadesimple.org/index.ph ... 625.0.html

Code: Select all

{capture assign=currentpath}{$gCms->config.root_url}{$smarty.server.REQUEST_URI}{/capture}
[this message is written with 100% recycled bits]
nicmare
Power Poster
Power Poster
Posts: 1150
Joined: Sat Aug 25, 2007 9:55 am
Location: Berlin

Re: smarty abfrage?!

Post by nicmare »

ah super. so klappts! nun habe ich endlich auch mal gelernt wofür dieses capture zeugs gut ist :D
Jos
Support Guru
Support Guru
Posts: 4017
Joined: Wed Sep 05, 2007 8:03 pm
Location: The Netherlands

Re: smarty abfrage?!

Post by Jos »

Kann auch mit cat modifier: http://www.smarty.net/manual/en/languag ... er.cat.php

Achte das die addresse nicht gut ist wenn du deine cmsms installation in eine Unterverzeichnis gemacht hat.
nicmare
Power Poster
Power Poster
Posts: 1150
Joined: Sat Aug 25, 2007 9:55 am
Location: Berlin

Re: smarty abfrage?!

Post by nicmare »

danke euch beiden :)
hlf

Re: [gelöst] smarty abfrage?!

Post by hlf »

Normal würde ich das so formulieren:

{assign var=currentpath value=`$gCms->config.root_url``$smarty.server.REQUEST_URI`}
nicmare
Power Poster
Power Poster
Posts: 1150
Joined: Sat Aug 25, 2007 9:55 am
Location: Berlin

Re: [gelöst] smarty abfrage?!

Post by nicmare »

was es nicht alles gibt…
cyberman

Re: [gelöst] smarty abfrage?!

Post by cyberman »

Tja ja, die Hochkommata wieder mal :) ...
Last edited by cyberman on Wed Aug 04, 2010 9:47 am, edited 1 time in total.
hlf

Re: [gelöst] smarty abfrage?!

Post by hlf »

Tja ja, die Hochkommata wieder mal
Eher Backticks - nachzulesen bei:

http://www.smarty.net/manual/de/languag ... quotes.php
cyberman

Re: [gelöst] smarty abfrage?!

Post by cyberman »

Sag ich (mein ich) doch ;) ...
Locked

Return to “Smarty-Tipps und -Tricks”