Kekkoweb wrote:
buongiorno a tutti.
sono nuovo qui e anche con made simple quindi abbiate pazienza per la mia ignoranza...
ho un problema che non capisco...
global $gCms;
$tpl_vars = $gCms->smarty->get_template_vars();
print_r($tpl_vars);
questo è il codice che uso ( { get_template_vars} ) perchè devo trovare una variabile di cui non so il nome
però quando lo inserisco nel template mi da pagina bianca e anche se lo inserisco in una pagina come codice php...bho
se non sono stato chiaro scusate, non sono un programmatore ma un grafico che per necessità deve improvvisarsi esperto php
Non capisco il codice, nei template usa solo {get_template_vars}
Se ti dà ancora pagina bianca probabilmente c'è qualcosa che non va e qualche variable "esplode", prova ad attivare il debug in config.php
se inserisco nel template { get_template_var } mi da pagina bianca anche se attivo il debug
se la tolgo mi svisualizza il debug cioè questo:
Generated in 0,202712 seconds by CMS Made Simple using 21 SQL queries and 6790980 bytes of memory (peak memory usage was 7098500
Debug: (0.007108) - (655292)
loading smarty
Debug: (0.010404) - (949252)
loading adodb
Debug: (0.011684) - (1043168)
loading page functions
Debug: (0.013827) - (1222204)
loading content functions
Debug: (0.016075) - (1455932)
loading pageinfo functions
Debug: (0.016615) - (1494772)
loading translation functions
Debug: (0.017004) - (1513888)
loading events functions
Debug: (0.018032) - (1604476)
loading php4 entity decode functions
Debug: (0.019749) - (1825040)
done loading files
Debug: (0.028111) - (2587056)
(mysql): SET NAMES 'utf8'
Error (0):
Debug: (0.028643) - (2600608)
(mysql): SELECT sitepref_name, sitepref_value from cms_siteprefs
Error (0):
Debug: (0.031209) - (2669600)
(mysql): SELECT * FROM cms_userplugins
Error (0):
Debug: (0,03632) - (3141944)
(mysql): SELECT * FROM cms_modules WHERE admin_only = 0 AND active = 1 ORDER by module_name
Error (0):
Debug display of 'End of include':(0,059184) - (4730000)
Debug display of 'Load Content Operations':(0,059382) - (4699292)
Debug display of 'End Load Content Operations':(0,064372) - (5178060)
Debug: (0,064636) - (5180848)
(mysql): SELECT content_id FROM cms_content WHERE default_content = 1
Error (0):
Debug: (0,065351) - (5186316)
(mysql): SELECT c.content_name, c.menu_text, c.content_id, c.content_alias, c.titleattribute, c.hierarchy, c.metadata, c.id_hierarchy, c.prop_names, c.create_date AS c_create_date, c.modified_date AS c_date, c.cachable, c.last_modified_by, t.template_id, t.encoding, t.modified_date AS t_date FROM cms_templates t INNER JOIN cms_content c ON c.template_id = t.template_id WHERE (c.content_alias = '15' OR c.content_id = '15') AND c.active = 1
Error (0):
Debug: (0,065579) - (5188952)
(mysql): SELECT MAX(modified_date) AS thedate FROM cms_content c
Error (0):
Debug display of 'Start Loading Hierarchy Manager':(0,065944) - (5189824)
Debug display of 'starting tree':(0,065976) - (5189824)
Debug: (0,06794) - (5334624)
file needs loading
Debug: (0,068678) - (5376884)
(mysql): SELECT * FROM cms_content WHERE parent_id = -1 ORDER BY hierarchy
Error (0):
Debug display of 'ending tree':(0,071808) - (5651756)
Debug display of 'End Loading Hierarchy Manager':(0,071859) - (5646688)
Debug: (0,07189) - (5646776)
start findNodeByTag
Debug: (0,071938) - (5646880)
end findNodeByTag
Debug: (0,074152) - (5789200)
(mysql): SELECT template_id, template_name, template_content, stylesheet, encoding, active, default_template, modified_date FROM cms_templates WHERE template_id = '20'
Error (0):
Debug: (0,081284) - (6539560)
(mysql): SELECT eh.tag_name, eh.module_name, e.originator, e.event_name, eh.handler_order, eh.handler_id, eh.removable FROM cms_event_handlers eh
INNER JOIN cms_events e ON e.event_id = eh.event_id
ORDER BY eh.handler_order ASC
Error (0):
Debug: (0,093945) - (6576900)
start findNodeByTag
Debug: (0,094002) - (6576944)
end findNodeByTag
Debug: (0,094054) - (6577100)
load properties called
Debug: (0,094316) - (6576896)
(mysql): SELECT * FROM cms_content_props WHERE content_id = '15'
Error (0):
Debug display of 'Start of Menu Manager Display':(0,11976) - (6711820)
Debug: (0,12006) - (6714668)
load properties called
Debug: (0,120384) - (6716712)
(mysql): SELECT * FROM cms_content_props WHERE content_id = '51'
Error (0):
Debug: (0,120697) - (6719136)
load properties called
Debug: (0,120908) - (6720400)
(mysql): SELECT * FROM cms_content_props WHERE content_id = '52'
Error (0):
Debug: (0,121333) - (6722072)
(mysql): SELECT * FROM cms_content WHERE content_id = '57'
Error (0):
Debug: (0,121544) - (6732036)
load from data is loading properties
Debug: (0,121578) - (6732260)
load properties called
Debug: (0,121784) - (6734952)
(mysql): SELECT * FROM cms_content_props WHERE content_id = '57'
Error (0):
Debug: (0,122036) - (6736156)
load properties called
Debug: (0,12224) - (6736416)
(mysql): SELECT * FROM cms_content_props WHERE content_id = '54'
Error (0):
Debug: (0,12253) - (6736756)
load properties called
Debug: (0,122811) - (6737392)
(mysql): SELECT * FROM cms_content_props WHERE content_id = '55'
Error (0):
Debug: (0,124195) - (6842068)
(mysql): SELECT content from cms_module_templates WHERE module_name = 'MenuManager' and template_name = 'simple_navigation'
Error (0):
Debug: (0,124446) - (6844484)
(mysql): SELECT module_name,template_name,modified_date
FROM cms_module_templates
Error (0):
Debug display of 'End of Menu Manager Display':(0,168027) - (6848868)
Debug: (0,16826) - (6811200)
start findNodeByTag
Debug: (0,168311) - (6811200)
end findNodeByTag
Debug: (0,170252) - (6811172)
start global_content_get_template
Debug: (0,171653) - (6886916)
(mysql): SELECT htmlblob_id, htmlblob_name, html, owner, modified_date FROM cms_htmlblobs WHERE htmlblob_name = 'footer'
Error (0):
Debug: (0,171839) - (6887372)
end global_content_get_template
Debug: (0,171884) - (6887372)
start global_content_get_timestamp
Debug: (0,171924) - (6887372)
end global_content_get_timestamp
Debug: (0,201943) - (6987452)
(mysql): SELECT DISTINCT A.css_id,A.media_type,B.assoc_order
FROM cms_css A, cms_css_assoc B
WHERE A.css_id = B.assoc_css_id
AND B.assoc_type = 'template'
AND B.assoc_to_id = '20'
ORDER BY B.assoc_order
Error (0):
Kekkoweb wrote:
devo trovare la variabile di una voce di sotto menu e nel template far si che ogni pagina figlia di quella variabile abbia un contenuto le altre no
Quindi mi pare di capire che stai cercando nel MenuManager
Hai messo il tag nel corrispondente template del MenuManager?
che tag?
comunque è qualcosa che ha a che fare (presumo) con il parent "$node->parent true"
in poche parole devo identificare la variabile a cui sono assegnate le pagine (quelle di livello più alto per capirsi senza parent sopra) e poi fare una if nel template in cui tutte le pagine che si creano figlie di quella pagina visualizzano una cosa altrimenti no.
il tag è {get_template_vars}, tutti gli oggetti contrassegnati da {} MA non è presente $ subito dopo (es: $node->parent) sono dei tag, poi a seconda dell'oggetto è un plugin, modulo, UDT, GCB, comando smarty, ...
Kekkoweb wrote:
comunque è qualcosa che ha a che fare (presumo) con il parent "$node->parent true"
in poche parole devo identificare la variabile a cui sono assegnate le pagine (quelle di livello più alto per capirsi senza parent sopra) e poi fare una if nel template in cui tutte le pagine che si creano figlie di quella pagina visualizzano una cosa altrimenti no.
Nel tuo menu template hai un codice del tipo:
......
{foreach from=$entry item=node} {$node|print_r}
......
......
......
{/foreach}
......
All'interno di quel codice inserisci la parte in rosso
Questo stamperà a video tutto quello che conosce di $node (DI OGNI MENU)
Guarda i nomi ed i loro valori