4 Posts
Hologram
9 years ago
5
Topic

I am working on real estate website

and want to know How to display icon (for sale - for rent - for share) on image intro, or we can say replace value of certain field with corresponding image.

Any help or idea will be appricaiated, 

Thanks

Get a VIP membership
175 Posts
webcastor
9 years ago
0
Level 1

Actually, two methods come to my mind:

  1. Turn JText on in Seblod > Options > Language; Use Select Simple or Multiple for 3 statuses (for sale-for rent-for share); in Language Manager > Overrides insert COM_CCK_FOR_SALE and other two strings with <img src="/your_status_icon.png" />
  2. Use NoNumber ReReplacer instead of JText to substitute the same stuff you did under number 1

The resulting field should be placed in a position different then MAINBODY, or you can style it by applying a special class in view #2 (such that you can float it or something).

693 Posts
rpoy
9 years ago
2
Level 1

Hi,

And yet another method...

On your site add the images that you want to use (ie sale.jpg, rent.jpg, share.jpg)

In the Admin/Site Form:

Create a field:

  • Simple Select field (icon_select) with options: sale, rent, share

In the Content section of the content type:

  • Define the Simple Select Field (icon_select) typography as HTML like so:

<img src="/./images/$cck->getValue('icon_select');.jpg">

The trick is to make sure that the option names in the simple select are exactly the same as the file names located on the server.

hope that helps,

Randy

175 Posts
webcastor
9 years ago
1
Level 2

Is it possible to use *value* so that there is no need to hunt down the variable name?

693 Posts
rpoy
9 years ago
0
Level 3

Hi webcastor!

Yes!  That works too.

<img src="/./images/*value*">

You might also need to append the file extension depending on how you do it.  If the options in the select field contains the extension, then there is no need to include it in the html string.

regards,

Randy

175 Posts
webcastor
9 years ago
0
Level 1

Hi Randy!

Thanks for your answer! I thought you used getValue() because select fields must be treated differently, but this is awesome.
By the way, typography turns out to be one of strong points in SEBLOD (regarding customizations).

Best regards!

Get a VIP membership