Form2Content Forum

Questions and answers for Form2Content, a Joomla CCK.
  1. Stefan
  2. F2C article templating
  3. Wednesday, 02 March 2016
  4.  Subscribe via email
Hi, I am using F2C Lite version 5.5.0 in Joomla 3.4.8., and I have two questions about image implementation.

1) In my F2C templates I am using the field {$IMAGE}, which output I have selected in the content type as "raw image url". My intro template looks like that:

<div class="f2c_intro">
{if $IMAGE}
<a href="/{$JOOMLA_ARTICLE_LINK}" ><img src="/{$IMAGE}" align="left" border="none" style="padding-right:10px; padding-bottom:10px;" alt="{$JOOMLA_TITLE}" /></a>
{/if}
{$INTRO}
</div>


When I save my articles, I receive in Joomla articles the complete image URL like this:

...
<a href="index.php?option=com_content&view=article&id=1194:new-article&catid=2:articles" ><img src="<img src="http://myurl.com/images/stories/com_form2content/p2/f165/12.jpg" alt="" title="" width="200" height="133"/>" align="left" border="none" style="padding-right:10px; padding-bottom:10px;" alt="New Article" /></a>
...

With such a complete image URL there could be problems in future when I would like to move my articles to another website. This is why I would like to receive the image URL as relative URL, without the domain. It should look like this:

"/images/stories/com_form2content/p2/f165/12.jpg"

May be there is a way to achieve this using the {$F2C_IMAGES_PATH_RELATIVE} parameter. Could you please give an example how to implement this parameter?


2) After I migrated my website from Joomla 2.x to Joomla 3.x, some images in older articles have been overwritten by images of new articles, created by F2C. I suppose that F2C uses some the same image directories in J3x as it did in J2x. So I see a need to change the F2C path for new images. Is this also possible through the {$F2C_IMAGES_PATH_RELATIVE} parameter?

Thank you in advance and best regards.
Responses (4)
Accepted Answer Pending Moderation
Hi Stefan,

For relative paths you can use this syntax to display an image:

[img src="/images/stories/{$IMAGE_PATH_RELATIVE}" /]


where IMAGE is the fieldname of your image field.

best,
Julien

PS: User these brackets for the image tag: < and >. I could not get them to display properly on the forum.
  1. more than a month ago
  2. F2C article templating
  3. # 1
Accepted Answer Pending Moderation
Hi Julien,

thanks for this example that answered my first question perfectly.

Now I am still looking for a way to change the path to the image directory for new F2C articles. I have tried to change the syntax of your example like this:

img src="/images/stories/2016/{$IMAGE_PATH_RELATIVE}"


I also created the directory /2016/.

Unfortunately, it works only the half way. In my Joomla articles, I receive now this image path:

img src="/images/stories/2016/com_form2content/p2/f165/12.jpg


But this new directory /2016/ remains empty. Is there a way to tell F2C to store the images in my new directory /2016/?

Best regards,
Stefan
  1. more than a month ago
  2. F2C article templating
  3. # 2
Accepted Answer Pending Moderation
Hi Stefan,

In the Lite version, the images are always stored in the same place.

In the Pro version it is possible to configure a different location for the images. This location then applies to all F2C images for that Joomla installation.

best,
Julien
  1. more than a month ago
  2. F2C article templating
  3. # 3
Accepted Answer Pending Moderation
Hi Julien,

this would probably be a good argument to buy the Pro version. Without this problem, I am quite satisfied with the Lite functionality.

May be you could also consider to define different image paths in different F2C versions. If somebody used F2C Lite in Joomla 2.x, migrated to J3x and implemeted again F2C Lite, he will probably face the same problem:
Some of his old image files will be owerwritten by F2C Lite.

Best regards,
Stefan
  1. more than a month ago
  2. F2C article templating
  3. # 4
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.