Vue combinée Vue Plate Arborescence
Sujets [ Précédent | Suivant ]
toggle
Soukaina HAJI
Template asset publisher
25 août 2014 09:04
Réponse

Soukaina HAJI

Rang: Regular Member

Publications: 196

Date d'inscription: 17 juin 2014

Publications Récentes

Hello,

I want to make this template work :
 1<table>
 2<tr>
 3<td  style="padding: 0 0 0 0;">
 4<h3 style="margin: 0 0 0 0;"> <span>$reserved-article-title.getData()</span></h3>
 5<span>$content.getData()</span>
 6<br/>
 7#if ($image.getData()!="")
 8<img  src="$image.data" width="150"/><br/>
 9#end
10#foreach($temp in $url.siblings)
11#if ($lien.data!="")
12    <a target="_blank" href="$temp.data">$temp.data</a><br/>
13#end
14#end
15</td>
16</tr>
17</table>


It shows the following :


If it's possible a sample template to help me out
Liferay 6.2 ce ga2
thank you
enayath ulla
RE: Template asset publisher
26 août 2014 01:02
Réponse

enayath ulla

Rang: Junior Member

Publications: 65

Date d'inscription: 15 juillet 2013

Publications Récentes

Hello

I have attached structure and template copy ....it may help you,its in working condition u can just place the structure and template in proper place and check it


Thank You
........
Pièces jointes: Structure.txt (1,7k), Template.txt (0,4k)
Soukaina HAJI
RE: Template asset publisher
26 août 2014 01:37
Réponse

Soukaina HAJI

Rang: Regular Member

Publications: 196

Date d'inscription: 17 juin 2014

Publications Récentes

Thanks a loot,
It's working now , but I want to display the image in the first page :



it seems to me like it can't read html code !!

tempalte:

 1<table>
 2<tr>
 3<td  style="padding: 0 0 0 0;">
 4<h3 style="margin: 0 0 0 0;"> <span>$reserved-article-title.getData()</span></h3>
 5<span>$content.getData()</span>
 6<br/>
 7#if (!$image.isEmpty())
 8    <img src="$image.getData()" width="150"/><br/>
 9#end
10</td>
11</tr>
12</table>
enayath ulla
RE: Template asset publisher
26 août 2014 02:31
Réponse

enayath ulla

Rang: Junior Member

Publications: 65

Date d'inscription: 15 juillet 2013

Publications Récentes

Hi soukaina


Check this ...it will work fine to display the image


Thank You
Pièces jointes: Structure.txt (1,7k), Template.txt (0,4k)
Soukaina HAJI
RE: Template asset publisher
26 août 2014 02:46
Réponse

Soukaina HAJI

Rang: Regular Member

Publications: 196

Date d'inscription: 17 juin 2014

Publications Récentes

Yes It display the image but after clicking on Read More ,
Why I said it doesn't recognize html code is because even though the title is between h3 valise it display it normally ...

thank you
enayath ulla
RE: Template asset publisher
26 août 2014 07:50
Réponse

enayath ulla

Rang: Junior Member

Publications: 65

Date d'inscription: 15 juillet 2013

Publications Récentes

Hi soukaina

Its recognizing the HTML come ,there is no issue in that ,i have attached a scrrenshot u can see my name under h3 tag.
Soukaina HAJI
RE: Template asset publisher
26 août 2014 03:06
Réponse

Soukaina HAJI

Rang: Regular Member

Publications: 196

Date d'inscription: 17 juin 2014

Publications Récentes

hmmmm I see , I dnt know why It not working for me though the structure and template are the same as what u've sent me..

this is the template:
 1<table>
 2<tr>
 3<td  style="padding: 0 0 0 0;">
 4<h3 style="margin: 0 0 0 0;"> <span>$reserved-article-title.getData()</span></h3>
 5<span>$content.getData()</span>
 6<br/>
 7#if (!$image.isEmpty())
 8    <img src="$image.getData()" height="120" width="150"/><br/>
 9#end
10#foreach($temp in $url.siblings)
11    #if ($lien.data!="")
12        <a target="_blank" href="$temp.data">$temp.data</a><br/>
13    #end
14#end
15</td>
16</tr>
17</table>


and the structure:
 1
 2<root available-locales="en_US" default-locale="en_US">
 3    <dynamic-element dataType="string" indexType="keyword" name="content" readOnly="false" repeatable="false" required="false" showLabel="true" type="textarea" width="small">
 4        <meta-data locale="en_US">
 5            <entry name="label">
 6                <![CDATA[content]]>
 7            </entry>
 8            <entry name="predefinedValue">
 9                <![CDATA[]]>
10            </entry>
11            <entry name="tip">
12                <![CDATA[]]>
13            </entry>
14        </meta-data>
15    </dynamic-element>
16    <dynamic-element dataType="string" indexType="keyword" name="Texte4662" readOnly="false" repeatable="false" required="false" showLabel="true" type="text" width="small">
17        <meta-data locale="en_US">
18            <entry name="label">
19                <![CDATA[url]]>
20            </entry>
21            <entry name="predefinedValue">
22                <![CDATA[]]>
23            </entry>
24            <entry name="tip">
25                <![CDATA[]]>
26            </entry>
27        </meta-data>
28    </dynamic-element>
29    <dynamic-element dataType="image" fieldNamespace="wcm" indexType="keyword" name="image" readOnly="false" repeatable="false" required="false" showLabel="true" type="wcm-image" width="">
30        <meta-data locale="en_US">
31            <entry name="label">
32                <![CDATA[image]]>
33            </entry>
34            <entry name="predefinedValue">
35                <![CDATA[]]>
36            </entry>
37            <entry name="tip">
38                <![CDATA[]]>
39            </entry>
40        </meta-data>
41    </dynamic-element>
42</root>

thnxs
enayath ulla
RE: Template asset publisher
26 août 2014 03:17
Réponse

enayath ulla

Rang: Junior Member

Publications: 65

Date d'inscription: 15 juillet 2013

Publications Récentes

Hello

See your structure U don't have a field by name="reserved-article-title" to get the data in the template an show it in h3 tag

<dynamic-element dataType="string" indexType="keyword" name="reservearticletitle" readOnly="false" repeatable="false" required="false" showLabel="true" type="textarea" width="small">
<meta-data locale="en_US">
<entry name="label">
<![CDATA]>
</entry>
<entry name="predefinedValue">
<![CDATA[]]>
</entry>
<entry name="tip">
<![CDATA[]]>
</entry>
</meta-data>
</dynamic-element>

place the above code and get the same in template by placing <h3 style="margin: 0 0 0 0;"> <span>$reservearticletitle.getData()</span></h3>
Soukaina HAJI
RE: Template asset publisher
26 août 2014 03:54
Réponse

Soukaina HAJI

Rang: Regular Member

Publications: 196

Date d'inscription: 17 juin 2014

Publications Récentes

Ok I found the problem:
Configuration > Display settings >
Select "full content" in "Display template"

Thank you enayath for you help and you time
Soukaina HAJI
RE: Template asset publisher
26 août 2014 04:01
Réponse

Soukaina HAJI

Rang: Regular Member

Publications: 196

Date d'inscription: 17 juin 2014

Publications Récentes

An other question : I have some pictures I want to show which depends on the choice of select input :

1    #if ($Etablissement.getData()=="CESDA")
2        <img src="/documents/10179/31616/puces+intranet+CESDA.gif" height="60px" width="60px"/>
3    #end
4    #if ($Etablissement.getData()=="CSES")
5        <img src="/documents/10179/31616/puces+intranet+CSES.gif" height="60px" width="60px"/>
6    #end


The thing is I dnt know where to put this images so I can call it in src

thank you
karthik reddy
RE: Template asset publisher
26 août 2014 04:30
Réponse

karthik reddy

Rang: Junior Member

Publications: 53

Date d'inscription: 8 avril 2013

Publications Récentes

Hi Soukaina,
You can add images directly to document and media(Add DOCUMENTS AND MEDIA portlet).Create one folder and add images.You can call this images in webcontent.
enayath ulla
RE: Template asset publisher
26 août 2014 04:42
Réponse

enayath ulla

Rang: Junior Member

Publications: 65

Date d'inscription: 15 juillet 2013

Publications Récentes

##
## This template can be used to modify the look of a specific
## application.
##
## Please use the left panel to quickly add commonly used variables.
## Autocomplete is also available and can be invoked by typing "$".
##

#set($theme_image_path = $request.get("theme-display").get("path-theme-images"))


<div class="inner_content_main_bg tab-content">
<div class="container white_bg tab-pane active" id="ceo_speaks">
#foreach ( $ent in $entries)
<div class="row-fluid">
<div class="span12">
<div class="span9 content_padding">
<div class="dotted_border"></div>
<div class="about_content">
<div class="span3">
#set($assetRenderer = $ent.getAssetRenderer())
#set($className = $ent.getAssetRenderer().getClassName())
#if( $className == "com.liferay.portlet.journal.model.JournalArticle")
#set($journalArticle = $ent.getAssetRenderer().getArticle() )
#set($document = $saxReaderUtil.read($journalArticle.getContent()))
#set($rootElement = $document.getRootElement())
#foreach($dynamicElement in $rootElement.elements())
#set($element1=$dynamicElement.attributeValue("value"))
#if ($element1=="CESDA")
#if($element=="field_name_of_image1")
<img src="$dynamicElement.element('dynamic-content').getData()" alt=""/>
#elseif($element1=="CSES")
#if($element=="field_name_of_image2")
<img src="$dynamicElement.element('dynamic-content').getData()" alt=""/>
#end
#end
</div>
#end
</div>
</div>


</div>
</div>
#end
</div>
</div>
<script>

</script>