Please note that Form2Content is no longer being developed. All files from the latest version can be found on Github.

Form2Content Forum

Questions and answers for Form2Content, a Joomla CCK.
  1. Hans de Jong
  2. F2C article templating
  3. Thursday, 28 May 2020
  4.  Subscribe via email
I encountered a very strange phenomene - sometimes a readmore tag <hr id="system-readmore" /> is added, when there shouldn't be one.

In a custom main template, the entire html/smarty code is surrounded by:

{if $CAN_PUBLISH}
<div>
...
</div>
{/if}

{$CAN_PUBLISH} is a check box field. The author can check the field and then the main template part will be shown.

First thought was there was a mistake in the main template code, so I removed all the code, and no readmore tag showed up. Then I added part by part the code for showing the fields content. Still no readmore tag.

Almost added all of the code, and then the readmore tag showed again.

And now for the strange phenomene - when I removed the code backward again, the readmore tag still showed up. Even with the main template code

{if $CAN_PUBLISH}
<div>
</div>
{/if}

BTW - To test the effect I refreshed a F2C article each time by changing something in the backend F2C article form and saving, and checked the effect in the Joomla article editor.

Joomla! 3.9.18
Form2Content Pro version 6.17.4
Responses (2)
Accepted Answer Pending Moderation
Hi Hans,

When testing there are a couple of things important.

1) As you know it's Joomla that adds the read more. F2C adds the tag in the article content if there is ANY content in the Main Template part.

2) When testing make sure you clear cache between saves in F2C, otherwise the cached template is used.

3) Using the JAM is the right way to test the output :)

4) In your main template check for hidden characters like spaces etc. They might cause the template not to be completely empty.

For now I think part 2 might be causing the problems, just changing content isn't enough.

Regards,
Patrick
Please read the F2C documentation before asking questions! Thank you if you've done so ;)
  1. more than a month ago
  2. F2C article templating
  3. # 1
Accepted Answer Pending Moderation
Thanks,

I will test the original template soon again. For the moment I decided to use the empty main part of the article to show a useful message.

Regards,

Hans
  1. more than a month ago
  2. F2C article templating
  3. # 2
  • Page :
  • 1


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