Problems, need help? Have a tip or advice? Post it here.
4 posts Page 1 of 1
When I upload an image using the image tag I get the whole path to the image showing up on the page. Why is that and how can I make it go away? See the image attached for an example of what I mean. Thanks in advance

Attachments

Hi alexriverajr

May i have a look at the code you wrote.

Regards
ARK
Ark this is my code:


Code: Select all

<!-- column 1 -->
   <div class="column-240" >
   <!--Web Design Group-->
                <cms:editable name='webdesign_sec' label='Web Design' desc='Web Design Section' type='group' />
   <h2 class="green_text">
      <cms:editable name='row1_title' label='Row 1 Title' desc='Enter title of property here' type='text' group='webdesign_sec'>Web</cms:editable>
   </h2>
      <cms:editable name='webdesign_image' label='Web Design Image' height="220px" width="220px" type='image' group='webdesign_sec'/>
   <img src="<cms:show webdesign_image />" />
   </div>
<!-- /end column 1 -->

Its to be straight forward. I have this problem with any image upload I do. Can't figure it out. Thanks

Hi Alex,

Your code is behaving exactly as expected.

The following line of your code creates an editable region and also outputs whatever value is contained within the editable region -
Code: Select all
<cms:editable name='webdesign_image' label='Web Design Image' height="220px" width="220px" type='image' group='webdesign_sec'/>

While the following code simply outputs whatever value is contained within the editable region.
Code: Select all
<cms:show webdesign_image />

So effectively, you are outputting the image's path (webdesign_image editable region's value) twice.

The following is the correct way -
Code: Select all
<img src="<cms:editable name='webdesign_image' label='Web Design Image' height="220px" width="220px" type='image' group='webdesign_sec'/>" />

where we are creating the region as well as using the output of the editable region as the src of the img tag.
4 posts Page 1 of 1

Who is online

In total there are 7 users online :: 0 registered, 0 hidden and 7 guests
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 7 guests