Jump to content

Template System


Recommended Posts

Posted

A new version has been uploaded to the Marketplace. Changes include:

  • Updated and tested for 4.2 Compatibility
  • Ability to place template content at the top of the item page, under the title. (Example: when viewing a topic, the content would be shown directly under the topic title, before any posts)
  • Ability to place template content anywhere on the page. (Note: this feature will require theme edits.)
  • HTML Editor fields were not displayed correctly. Fixed.
Posted
17 hours ago, HeadStand said:

Se ha subido una nueva versión al Marketplace. Los cambios incluyen:

  • Actualizado y probado para 4.2 Compatibilidad
  • Posibilidad de colocar el contenido de la plantilla en la parte superior de la página del artículo, bajo el título. (Ejemplo: al ver un tema, el contenido se mostraría directamente bajo el título del tema, antes de cualquier publicación)
  • Posibilidad de colocar el contenido de la plantilla en cualquier lugar de la página. (Nota: esta función requerirá ediciones de temas.)
  • Los campos del editor HTML no se mostraron correctamente. Fijo.

You can apply to the topic list?

Or only into topic

Posted
On 9/8/2017 at 9:49 AM, User2016 said:

You can apply to the topic list?

Or only into topic

Only the topic. I had intended to implement this for the topic list, but some of the more recent changes to IPS has made my original approach impossible. I have not yet been able to find a good solution for that.

  • 1 month later...
Posted

Hi! I have a few questions:

1) How does this app store the data? In the same forums_posts table as the main post content? As I remember in IPS 3.4 this app worked in this way.

a) If no, does it mean that uninstallation of this app will remove the "forms data" from all existing topics?

b) Are these fields searchable?

2) Can I put custom fields after the topic title field and before the main topic content text area?

3) Can I generate topic title and topic content based on custom fields? For example, user has to fill in two fields: "Movie title" and "Year", and we automatically generate a topic title like

{movie_title} [{year}]

example:

The Shawshank Redemption [1994]

4) I already bought this app for IPS 3.4. Do I have any discount for this version?

P.S. The app page in the Marketplace really needs some screenshots on behalf of the user.

  • 4 weeks later...
Posted (edited)

I use the "date of birth" field in a topic template. The field appears fine when creating a new topic or editing it, but it shows up weird.

For example, this is how it shows up when the DOB is set to "1988-09-22" (see screenshot). Not sure why there's "9"??

weird.PNG

 

Also, when I edit a topic, the DOB always resets back to "1969-12-31".

Edited by MarilynWallace
  • 3 weeks later...
Posted (edited)

@HeadStand , thanks for this very nice addon. 

It is very cool to have the option to allow multiple Sets per container. But if there is only one Set available, how can I get it to have this one selected by default when a user creates a topic?

Thank you.

template.png

Edited by Ramsesx
Mention username doesn't work on the first attempt
  • 2 weeks later...
Posted

Hi, i was wondering if there is any instructions on how to modify the default templates in this.  For example, if i want a URL field to have a link, how can i set it up so URL's actually have the <A HREF code before the data, but if its not a URL field, it doesn't have this?

Posted
11 hours ago, Adam_S said:

Hi, i was wondering if there is any instructions on how to modify the default templates in this.  For example, if i want a URL field to have a link, how can i set it up so URL's actually have the <A HREF code before the data, but if its not a URL field, it doesn't have this?

That should be built in by default. Is that not working?

Posted
4 hours ago, HeadStand said:

That should be built in by default. Is that not working?

Hi, 

Ah ok, No, it's not working on my board

Thanks

 

Posted

Greetings.

I am looking for a way to create custom/sortable table headers/columns/fields on the forum page view that can be inputted when a topic is created.

For example, when a post is created, maybe a custom field for website link is inputted.
This website link shows on the topic post (as done by your app), but also on the forum view.

Another example would be custom script/html input for values pulled from API data using specific JSON entries.

Can "Template System" support this type of mod? It looks like Template System will only output on the topic view page rather than the forum/table view page.

Posted
On 12/11/2017 at 12:08 PM, 3hydro8 said:

Greetings.

I am looking for a way to create custom/sortable table headers/columns/fields on the forum page view that can be inputted when a topic is created.

For example, when a post is created, maybe a custom field for website link is inputted.
This website link shows on the topic post (as done by your app), but also on the forum view.

Another example would be custom script/html input for values pulled from API data using specific JSON entries.

Can "Template System" support this type of mod? It looks like Template System will only output on the topic view page rather than the forum/table view page.

The forum view is not currently supported. I would love to support it, but I haven't yet found a way to implement it across all components of the suite (because of course, as soon as I support it in the forum view, I have to support it in the calendar view, the blog view, etc, etc).

Posted
On 12/7/2017 at 10:35 PM, Adam_S said:

A URL field.  I have two URL fields actually, neither appear as a clickable link when displayed

That's odd. I would have thought that was built in to the IPS custom field code (which is what I'm using). Weird.

Anyway, here is the default view template. You'll notice that the $data array has the $fieldKey (which you define when you create the custom fields) and the $fieldValue.

<div class="ipsSpacer_top">
    {{foreach $data as $fieldKey => $fieldValue}}
    {{if $fieldValue['value'] || !$fieldValue['hide']}}
    <div class="cTemplateField">
        <span class="cTemplateField_label">{{$label = 'template_' . $fieldKey . '_label';}}</span>
        <span class="cTemplateField_value">{$item->$label}: {$fieldValue['value']|raw}</span>
    </div>
    {{endif}}
    {{endforeach}}
</div>

At the moment, I don't have a way to check the field type, although I can add that in the next release. Instead, you can use the fieldKey to do something like this:

<div class="ipsSpacer_top">
    {{foreach $data as $fieldKey => $fieldValue}}
    {{if $fieldValue['value'] || !$fieldValue['hide']}}
    <div class="cTemplateField">
        <span class="cTemplateField_label">{{$label = 'template_' . $fieldKey . '_label';}}</span>
        {{if $fieldKey == 'myUrlField'}}
        <span class="cTemplateField_value"><a href="{$fieldValue['value']}">{$fieldValue['value']}</a></span>
        {{else}}
        <span class="cTemplateField_value">{$item->$label}: {$fieldValue['value']|raw}</span>
        {{endif}}
    </div>
    {{endif}}
    {{endforeach}}
</div>

Let me know if that helps.

Posted
On 12/14/2017 at 12:13 AM, HeadStand said:

That's odd. I would have thought that was built in to the IPS custom field code (which is what I'm using). Weird.

Anyway, here is the default view template. You'll notice that the $data array has the $fieldKey (which you define when you create the custom fields) and the $fieldValue.


<div class="ipsSpacer_top">
    {{foreach $data as $fieldKey => $fieldValue}}
    {{if $fieldValue['value'] || !$fieldValue['hide']}}
    <div class="cTemplateField">
        <span class="cTemplateField_label">{{$label = 'template_' . $fieldKey . '_label';}}</span>
        <span class="cTemplateField_value">{$item->$label}: {$fieldValue['value']|raw}</span>
    </div>
    {{endif}}
    {{endforeach}}
</div>

At the moment, I don't have a way to check the field type, although I can add that in the next release. Instead, you can use the fieldKey to do something like this:


<div class="ipsSpacer_top">
    {{foreach $data as $fieldKey => $fieldValue}}
    {{if $fieldValue['value'] || !$fieldValue['hide']}}
    <div class="cTemplateField">
        <span class="cTemplateField_label">{{$label = 'template_' . $fieldKey . '_label';}}</span>
        {{if $fieldKey == 'myUrlField'}}
        <span class="cTemplateField_value"><a href="{$fieldValue['value']}">{$fieldValue['value']}</a></span>
        {{else}}
        <span class="cTemplateField_value">{$item->$label}: {$fieldValue['value']|raw}</span>
        {{endif}}
    </div>
    {{endif}}
    {{endforeach}}
</div>

Let me know if that helps.

Thanks for that.  That didn't seem to work for some reason...  Any ideas what might be going wrong?  Do you want me to private message you about it?

Posted
14 hours ago, Adam_S said:

Thanks for that.  That didn't seem to work for some reason...  Any ideas what might be going wrong?  Do you want me to private message you about it?

Yes. Please include your actual template content.

  • 5 weeks later...
Posted

Hi,

Is there any way to display attached image in the output view ?

Tried many things even with \IPS\core\extensions\core\EditorMedia\Attachment but without success :(

  • 3 weeks later...
Posted

Can the custom fields be retrieved via the REST API?  I'd like to use this to add additional text fields to calendar events

Posted
On 1/20/2018 at 1:40 AM, Curious Cosmos said:

Does this allow adding fields to thread replies?

No.

11 hours ago, Alay said:

Can the custom fields be retrieved via the REST API?  I'd like to use this to add additional text fields to calendar events

Not at this time, although that's an interesting suggestion that I hadn't considered. I can add it to my list, but there's no timeline at the moment. I'm swamped with custom work.

  • 2 months later...
Posted

@HeadStand Template System app is no longer working in our forums. Its taking the input in custom fields but not posting any data in forum topics, While editing the topic we can see the data.

It would be great if you can help or show us workaround to resolve this issue.

Posted (edited)

@HeadStand - I have a couple of questions regarding the template system. Could you please tell me:

1) Let's say someone has already submitted a thread that contains custom fields. Is it possible to display certain fields only to logged in users (or restrict viewing specific fields to specific user groups)?

2) Is there a way to sort threads based on field values?

3) Do you have plans to update this to work with IPS 4.3?

Edited by PrettyPixels
correct spelling error
Posted
36 minutes ago, priyesh.mehta94@gmail.com said:

@HeadStand Template System app is no longer working in our forums. Its taking the input in custom fields but not posting any data in forum topics, While editing the topic we can see the data.

It would be great if you can help or show us workaround to resolve this issue.

What version of IPS are you running? 

24 minutes ago, PrettyPixels said:

@HeadStand - I have a couple of questions regarding the template system. Could you please tell me:

1) Let's say someone has already submitted a threat that contains custom fields. Is it possible to display certain fields only to logged in users (or restrict viewing specific fields to specific user groups)?

2) Is there a way to sort threads based on field values?

3) Do you have plans to update this to work with IPS 4.3?

1) if you customize the view template. I do have plans to add permissions to each field, but haven't had a chance to do that yet. 

2) no. 

3) yes. I am updating my apps based on the number of purchases. This app is next in line. 

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...