eZ Community » Forums » Developer » Difference between the template code...
expandshrink

Difference between the template code and rendering on my browser (css declaration (classes and ids))

Difference between the template code and rendering on my browser (css declaration (classes and ids))

Thursday 29 September 2011 5:22:21 pm - 7 replies

Hi community,

I have a little problem between my template code and the rendering on my browser.

In fact, when I insert this code on my template :

  <select id="selection_gallery">
           {def $sschildren = fetch(content, list, hash(parent_node_id, $node.node_id,
                                                      sort_by, array("priority", true)))}
         
          
            {foreach $sschildren as $sschild}

                           <option id="{$sschild.node_id}" value="{$sschild.node_id}">
                                    {$sschild.name}
                           </option>
              
            {/foreach}
 </select>

I've this type or render on my browser :

 Sélectionnez une galerie :
<select>
    <option value="1519"> 1 </option>
    <option value="1520">  2 </option>
    <option value="1521"> 3 </option>
    <option value="1522"> 4 </option>
</select>

If you see thus both code, you can see that I lost my id.

I don't know why but I've this problem when I insert a object element in a xml bloc from the administration interface.

I've the same problem when I insert a flash object too. My object element is hidden and I flash don't play.

Anyone have an idea ?

Thanks a lot

Thursday 29 September 2011 5:32:33 pm

Or you are not editing the right template (use debug template, you can also check debug template options in admin interface) or you didn't clear the cache.

Modified on Thursday 29 September 2011 5:33:49 pm by Thiago Campos Viana

Thursday 29 September 2011 5:41:33 pm

Hi tiago,

I edit the right template and I cleared the cache.

These templates are generaly specific and any default override are used.

For example, for my select id problem, the template name is : gallery_object_general.tpl .

I don't know why but these bug are present just when I insert content object from XML Block on my administration Interface.

thanks

Thursday 29 September 2011 6:08:45 pm

Well, the output really doesn't seems to come from the same template, so I do believe you are not editing the right template as long you actually cleared the cache, so what happens when you edit the template and put the string: <h1>Hello Template</h1> ? (Please check the source code instead of the firebug, check if the h1 is rendered and if  <select id="selection_gallery"> is also there).

<h1>Hello Template</h1>
<select id="selection_gallery">
           {def $sschildren = fetch(content, list, hash(parent_node_id, $node.node_id,
                                                      sort_by, array("priority", true)))}
                           {foreach $sschildren as $sschild}
                           <option id="{$sschild.node_id}" value="{$sschild.node_id}">
                                    {$sschild.name}
                           </option>
                          {/foreach}
 </select>

Modified on Thursday 29 September 2011 6:10:26 pm by Thiago Campos Viana

Thursday 29 September 2011 6:11:56 pm

@ AGUENOT

You have not shown any example which mentions or shows your attempted usage of an xmlblock.

Please provide more detailed examples. As it is not clear what your -really- trying to do and what is going wrong.

What are you trying to do with an xmlblock?

Cheers,

Heath

Thursday 29 September 2011 6:16:44 pm

@ AGUENOT

You have not shown any example which mentions or shows your attempted usage of an xmlblock.

Please provide more detailed examples. As it is not clear what your -really- trying to do and what is going wrong.

What are you trying to do with an xmlblock?

Cheers,

Heath

I'm supposing he is using the "insert object" online editor feature and he is trying the view feature (embed/full/inline....) with some style (Itemized sub items ....) to render the selected object (a gallery), so eZ does use a template to render it, but he's having some trouble to render the object with the new template.

Modified on Thursday 29 September 2011 6:18:16 pm by Thiago Campos Viana

Friday 30 September 2011 9:28:32 am

Hi,
I was created my template for all of object and my overrides are good.
I think it is a problem with ezpublish but i'm not sure.
I use the same code in the same server on a ezpublish 4.2 installation and a ezpublish 4.4 installation but the result is different.
On my ezpublish 4.4 installation, the result when I insert object via xml block isn't the same as the version 4.2.
For the first, the result is looks like in the top of the topic.
For the second, the result is compiled correctly with my id css.

 

Regards

Modified on Friday 30 September 2011 9:29:07 am by AGUENOT Nicolas

Friday 30 September 2011 11:15:23 am

Hi,
I solved my problem.
In fact, the problem wasn't due to ezpublish installation but to the ezxmltext.tpl. This file was override by ezxmltext.tpl of xmlwash extension.
Regards

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from