Fórumok

Image is not getting displayed in web content

thumbnail
Apoorva Prakash, módosítva 12 év-val korábban

Image is not getting displayed in web content

Liferay Master Bejegyzések: 658 Csatlakozás dátuma: 2010.06.15. Legújabb bejegyzések
Hello All,
I'm using LR6.05.
I'm getting problem in web content using a template. Image is not getting displayed.
But when I'm opening for preview or display, the image is not coming.
I've tried without template too. Same thing is happening.
When I tried to debug it through FireBug, it gives the following URI
/image/journal/article?img_id=26172&t=1320151467035

I've checked the journalArticleImage table, the imageId is valid... But I was unable to find this struts path in struts-config.xml.
Please reveal some solution.
Thanks and Regards.
ma bu, módosítva 12 év-val korábban

RE: Image is not getting displayed in web content

Junior Member Bejegyzések: 31 Csatlakozás dátuma: 2010.05.14. Legújabb bejegyzések
hi,
by using the follwing HTML tag (in VM Skript), the image/document from document library is displayed properly
<img src="$imageURL">

in my structure there is a field called "imageURL" (type: Documents and Media) on top level of the structure.
Cheers
thumbnail
Apoorva Prakash, módosítva 12 év-val korábban

RE: Image is not getting displayed in web content

Liferay Master Bejegyzések: 658 Csatlakozás dátuma: 2010.06.15. Legújabb bejegyzések
Hello Ma Bu,
Thanks for your reply..
Can you please tell me, what is the value of $imageURL on the page.
Thanks and Regards.
Apoorva Prakash
thumbnail
Sagar A Vyas, módosítva 12 év-val korábban

RE: Image is not getting displayed in web content

Liferay Master Bejegyzések: 679 Csatlakozás dátuma: 2009.04.17. Legújabb bejegyzések
Apoorva Prakash:
Hello All,
I'm using LR6.05.
I'm getting problem in web content using a template. Image is not getting displayed.
But when I'm opening for preview or display, the image is not coming.
I've tried without template too. Same thing is happening.
When I tried to debug it through FireBug, it gives the following URI
/image/journal/article?img_id=26172&amp;t=1320151467035

I've checked the journalArticleImage table, the imageId is valid... But I was unable to find this struts path in struts-config.xml.
Please reveal some solution.
Thanks and Regards.


Hi Apoorva,

Two way of displaying image either put it on Structure and access it from template as below

<img height=50px; width=48px; src="$field.DocumentImage.data" />


Here field is name of image field set by you in structure.

or if you wish to access some image from theme then you can get path like below.

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


Here imagePath will return path upto images folder of theme.

Hope this help emoticon

Thanks,
Sagar Vyas
thumbnail
Apoorva Prakash, módosítva 12 év-val korábban

RE: Image is not getting displayed in web content

Liferay Master Bejegyzések: 658 Csatlakozás dátuma: 2010.06.15. Legújabb bejegyzések
Thanks Ma Bu and Sagar...
It was some other issue, relate with tomcat structuring.

Regards,
Apoorva Prakash
Narendra Dodiya, módosítva 11 év-val korábban

RE: Image is not getting displayed in web content

New Member Bejegyzés: 1 Csatlakozás dátuma: 2013.02.08. Legújabb bejegyzések
Hi Sagar A Vyas,
can you describe some more about : $request.get("theme-display").path-theme-images
where theme-display is set and about method path-theme-images ?
thumbnail
Amit Doshi, módosítva 11 év-val korábban

RE: Image is not getting displayed in web content

Liferay Master Bejegyzések: 550 Csatlakozás dátuma: 2010.12.29. Legújabb bejegyzések
Hi Narendra,

From $request, you will be able to find all this variables value.
So, if you were to dump a $request variable from a template it would look like this:


{ render-url-exclusive=http://localhost:8080/web/workshop/home ?p_p_id=56_INSTANCE_6860&amp;p_p_lifecycle=0 &amp;p_p_state=exclusive&amp;p_p_mode=view&amp; p_p_col_id=column-1&amp;p_p_col_count=1, auth-type=, scheme=http, render-url-normal=http://localhost:8080/web/workshop/home ?p_p_id=56_INSTANCE_6860&amp;p_p_lifecycle=0&amp; p_p_state=normal&amp;p_p_mode=view&amp; p_p_col_id=column-1&amp;p_p_col_count=1, locale=en_US, attributes={ COMPANY_ID=10095, PORTLET_ID=56_INSTANCE_6860, RENDER_PORTLET_COLUMN_POS=0, CURRENT_COMPLETE_URL=http://localhost:8080/web/workshop/home, LAST_PATH={ contextPath=/web, path=/workshop/home }, FRIENDLY_URL=/web/workshop/home, com.liferay.portal.servlet.filters.strip.StripFilterSKIP_FILTER=true, PORTLET_PARALLEL_RENDER=true, RENDER_PORTLET_COLUMN_ID=column-1, LAYOUT_FRIENDLY_URL=/home, CURRENT_URL=/web/workshop/home, RENDER_PORTLET_COLUMN_COUNT=1, org.apache.struts.action.mapping.instance=ActionConfig [path=/journal_content/view, scope=session, type=com.liferay.portlet.journalcontent.action.ViewAction, validate=true,cancellable=false, LIFERAY_SHARED_PAGE_KEYWORDS=[ad], USER_ID=10150, PORTLET_STRUTS_ACTION=/journal_content/view, com.liferay.portal.servlet.filters.gzip.GZipFilterSKIP_FILTER=true }, render-url-pop-up=http://localhost:8080/web/workshop/home ?p_p_id=56_INSTANCE_6860&amp;p_p_lifecycle=0&amp; p_p_state=pop_up&amp;p_p_mode=view&amp;p_p_col_id=column-1 &amp;p_p_col_count=1, render-url-maximized=http://localhost:8080/web/workshop/home ?p_p_id=56_INSTANCE_6860&amp;p_p_lifecycle=0&amp; p_p_state=maximized&amp;p_p_mode=view&amp; p_p_col_id=column-1&amp;p_p_col_count=1, render-url-minimized=http://localhost:8080/web/workshop/home ?p_p_id=56_INSTANCE_6860&amp;p_p_lifecycle=0&amp; p_p_state=minimized&amp;p_p_mode=view&amp; p_p_col_id=column-1&amp;p_p_col_count=1, server-port=8080, portlet-mode=view, secure=false, action=false, theme-display={ secure=false, scope-group-id=10174, portal-url=localhost:8080, plid=10265, path-main=/c, i18n-language-id=, url-portal=localhost:8080, do-as-user-id=, path-context=, path-image=/image, user-id=10150, language-id=en_US, company-id=10095, locale=en_US, time-zone=UTC, path-friendly-url-public=/web, path-theme-images=/sesameworkshop-theme/images, real-user-id=10150, cdn-host=, path-friendly-url-private-group=/group, server-name=localhost, path-friendly-url-private-user=/user, server-port=8080, portlet-display={ title=Journal Content, portlet-name=56, instance-id=6860, resource-pk=10265_LAYOUT_56_INSTANCE_6860, root-portlet-id=56, id=56_INSTANCE_6860 } }, parameters=, container-type=portlet, context-path=/, content-type=text/html, render-url=http://localhost:8080/web/workshop/home ?p_p_id=56_INSTANCE_6860&amp;p_p_lifecycle=0&amp; p_p_state=normal&amp;p_p_mode=view&amp; p_p_col_id=column-1&amp;p_p_col_count=1, remote-user=10150, window-state=normal, server-name=localhost, container-namespace=/, portlet-session={ portlet-attributes=, application-attributes={ com.liferay.portal.kernel.util.ProgressTracker_PERCENT=100, j_username=10150, HTTPS_INITIAL=false, LIFERAY_SHARED_VISITED_GROUP_ID_PREVIOUS=10100, LAST_PATH={ contextPath=/web, path=/workshop/home }, USER_ID=10150, LIFERAY_SHARED_VISITED_GROUP_ID_RECENT=10174, org.apache.struts.action.LOCALE=en_US } }, portlet-namespace=_56_INSTANCE_6860_, portlet-session-id=1D8EA0980982E0C4DD5199B092450A2E } }}} 


From the above you will be able to find theme-display and also path-theme-images.

For more info refer this link.

Hope it will be useful.

Thanks & Regards,
Amit Doshi
thumbnail
Sagar A Vyas, módosítva 11 év-val korábban

RE: Image is not getting displayed in web content

Liferay Master Bejegyzések: 679 Csatlakozás dátuma: 2009.04.17. Legújabb bejegyzések
Narendra Dodiya:
Hi Sagar A Vyas,
can you describe some more about : $request.get("theme-display").path-theme-images
where theme-display is set and about method path-theme-images ?


Narendra,

As precisely described by Amit.

Just wanted to add on top of this is like " $request " it is not actual object we are pointing in Template.

It is just a Map you can say with key and value.

so if you want to access any value[in our example its theme's image path]you should know key[in our example its theme-display].

And if you want to know all keys and value as per Amit said display $request object you will get idea

HTH

Thanks,
Sagar Vyas