Skip to Content Skip to Menu

How to control thumbnail ?

  • dotcom22
  • dotcom22
  • OFFLINE
  • Posts: 522
  • Thanks: 14
  • Karma: 4
10 years 5 months ago #245164 by dotcom22
How to control thumbnail ? was created by dotcom22
When I upload a custom image (not avatar) 2 file are generated (normal and thumbnail) according to my settings. I would like output in some situation normal image or thumbnail using substitution but I don't see how to do.

If I use [cb_myimage] this output the full image url instead only file name. This is strange because when I look in database, the value stored is well the file name only and not the full url. I thought when using RAW substitution, this was for output value only without any other code.

How to do for get only this:

cb_myimage_440_537a6b2dd4f2c.jpg

instead:

www.site.com/images/comprofiler/cb_myimage_440_537a6b2dd4f2c.jpg

??

Then I noticed thumbnail image are named such tncb_myimage_440_537a6b2dd4f2c.jpg that mean you place the prefix "tn" on each generated thumbnail. Now my goal was to use something such tn[cb_myimage] for target only thumbnail file name and build my own html for display image like I wish.

I seen is possible to use [cb:userfield field="cb_myimage" reason="list" /] but even if like that I can get the thumbnail, I get always the full url. Furthermore the thumbnail have a link who redirect to normal image when clicked and this I don't want.

any clue ?

I use Joomla 3.3.6 - CB 2.0.4 - CBSubs 4 - Several Incubator plugins

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
10 years 5 months ago #245177 by krileon
Replied by krileon on topic How to control thumbnail ?
The raw value for image fields is the image path. We use getFields API calling with PHP output to properly grab field values using API. If you wan the thumbnail URL you can use the below.

[cb:userfield field="cb_myimage" reason="list" output="php" /]


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • dotcom22
  • dotcom22
  • OFFLINE
  • Posts: 522
  • Thanks: 14
  • Karma: 4
10 years 5 months ago - 10 years 5 months ago #245185 by dotcom22
Replied by dotcom22 on topic How to control thumbnail ?
I tested your substitution but this don't work and the code appear instead to be substituted.. However like I said is not the path I need but simply the thumbnail file name...

I use Joomla 3.3.6 - CB 2.0.4 - CBSubs 4 - Several Incubator plugins
Last edit: 10 years 5 months ago by dotcom22.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
10 years 5 months ago #245219 by krileon
Replied by krileon on topic How to control thumbnail ?

I tested your substitution but this don't work and the code appear instead to be substituted..

Confirmed the below will work.

<p>Avatar URL: [avatar]</p>
<p>Avatar Thumbnail URL: [cb:userdata field="avatar" reason="list" /]</p>

You can use any image field you like. This will give you path to full image or path to thumbnail image.

However like I said is not the path I need but simply the thumbnail file name...

You can't get just the filename anymore. It made raw value for image fields to be near useless. The raw value now always includes the path so you can use it in CSS, image tags, etc.. CB will fallback to grabbing straight from user object only if getField fails as getField is the appropriate way of grabbing field values through API.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum