Please read and follow the COMMON ISSUES first!
Always add your version information in every new post! Thank you!

Form2Content Forum

Questions and answers for Form2Content, a Joomla CCK.
  1. Pieter-Jan de Vries
  2. Form2Content Lite & Pro
  3. Tuesday, July 25 2017, 03:18 PM
  4.  Subscribe via email
When uploading/importing a content type which uses the same template as another content type, import fails and shows message:
There is already a Template with the name 'foo.tpl'.
Responses (4)
Julien Accepted Answer Pending Moderation
Hi Pieter-Jan,

This behaviour is by design. Template names are file-based. Therefore there can only be one template with the same name on a single F2C installation.

best,
Julien
  1. more than a month ago
  2. Form2Content Lite & Pro
  3. # 1
Pieter-Jan de Vries Accepted Answer Pending Moderation
Hello Julien,

Thanks for the swift reply. I think you misunderstood the problem though. I understand there can only be one instance of a template with a specific name, since templates are file based and all templates reside in one and the same folder. However, there is no reason not to use the same template for multiple content types.

Since it's not possible to have multiple templates with the same name, it seems obvious that multiple content types referencing the same template name, actually reference the same file. So no reason to fail and abort an import :)

Regards,
Pieter-Jan
  1. more than a month ago
  2. Form2Content Lite & Pro
  3. # 2
Julien Accepted Answer Pending Moderation
Hi Pieter-Jan,

Yes, you are right, a template can be re-used among different Content Types.

The problem with the import is that the template itself gets imported too, which would overwrite the already existing template. At this point it is unclear whether the templates are the same, we only know the name is the same at this point. This would introduce the risk of overwriting templates on the site.

The correct way to handle this should be to compare the templates. When they are the same, there's no need to import the template itself. When they differ you could interrupt the import (as happens now), or produce a warning that the template was not imported.

best,
Julien
  1. more than a month ago
  2. Form2Content Lite & Pro
  3. # 3
Pieter-Jan de Vries Accepted Answer Pending Moderation
Hi,

Alternatively you could include an import setting, allowing users to choose whether they want to overwrite
templates with the same name, ignore them or abort the import. An appropriate warning at the end of the import, which templates were overwritten or ignored, would add a bit of extra user friendliness indeed.

Regards,

Pieter-Jan
  1. more than a month ago
  2. Form2Content Lite & Pro
  3. # 4
  • Page :
  • 1


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