Jump to content

Template System


Recommended Posts

Posted (edited)
23 minutes ago, HeadStand said:

I pushed another fix. If this one doesn't work, I quit.

Updated. The field is created without error. When you create a topic with the given field - error 500. The theme is created, but when viewing its error 500

Edited by MGeek
Posted

This mod is going to be the death of me.

@MGeek no issues here with viewing. I created a new field, added it to my template. Created a topic, was able to view it.

Error 500s are usually logged to a PHP error log on the server (not the IPS logs). I'll need to see that log file in order to troubleshoot.

Posted (edited)
On 6.02.2017 at 2:36 PM, HeadStand said:

Again, you can customize the view template any way you want. That means, allowing the URL field to be displayed as a link, or hiding certain fields for certain groups. It uses the same logic as any other template in the IPS theme.

Hello! And you give me an example?

 

<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"><b><font color="#38aaff">{$item->$label}:</font></b> {$fieldValue['value']}</span>
    </div>
    {{endif}}
    {{endforeach}}
</div>

 

Edited by Maniutek
Posted

So, let's say you have a URL field with a key "url_field".

<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 == 'url_field'}}
        <span class="cTemplateField_value"><a href="{$fieldValue['value']}">{$fieldValue['value']}</a></span>
        {{else}}
        <span class="cTemplateField_value"><b><font color="#38aaff">{$item->$label}:</font></b> {$fieldValue['value']}</span>
        {{endif}}
    </div>
    {{endif}}
    {{endforeach}}
</div>

Now, let's say you have a field that you want to be for group id 4 (which happens to be the Admin group):

<div class="ipsSpacer_top">
    {{foreach $data as $fieldKey => $fieldValue}}
    {{if $fieldValue['value'] || !$fieldValue['hide']}}
    {{if $fieldKey == 'group_field' && member.inGroup( 4 )}}
    <div class="cTemplateField">
        <span class="cTemplateField_label">{{$label = 'template_' . $fieldKey . '_label';}}</span>
        <span class="cTemplateField_value"><b><font color="#38aaff">{$item->$label}:</font></b> {$fieldValue['value']}</span>
    </div>
    {{endif}}
    {{endif}}
    {{endforeach}}
</div>

You can use member.isAdmin() to check if the member is an Administrator, or you can check multiple groups by doing member.inGroup( array( 1,2,3) ).

On another note, I can add to my enhancement list view permissions on the field level. But no timeline.

Posted
5 minutes ago, HeadStand said:

So, let's say you have a URL field with a key "url_field".


<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 == 'url_field'}}
        <span class="cTemplateField_value"><a href="{$fieldValue['value']}">{$fieldValue['value']}</a></span>
        {{else}}
        <span class="cTemplateField_value"><b><font color="#38aaff">{$item->$label}:</font></b> {$fieldValue['value']}</span>
        {{endif}}
    </div>
    {{endif}}
    {{endforeach}}
</div>

Now, let's say you have a field that you want to be for group id 4 (which happens to be the Admin group):


<div class="ipsSpacer_top">
    {{foreach $data as $fieldKey => $fieldValue}}
    {{if $fieldValue['value'] || !$fieldValue['hide']}}
    {{if $fieldKey == 'group_field' && member.inGroup( 4 )}}
    <div class="cTemplateField">
        <span class="cTemplateField_label">{{$label = 'template_' . $fieldKey . '_label';}}</span>
        <span class="cTemplateField_value"><b><font color="#38aaff">{$item->$label}:</font></b> {$fieldValue['value']}</span>
    </div>
    {{endif}}
    {{endif}}
    {{endforeach}}
</div>

You can use member.isAdmin() to check if the member is an Administrator, or you can check multiple groups by doing member.inGroup( array( 1,2,3) ).

On another note, I can add to my enhancement list view permissions on the field level. But no timeline.

All nicely landscaped and I still do not know how usutawić this field on the URL terribly sorry ... but not too much to know in this ...

Posted

Now:

<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"><b><font color="#38aaff">{$item->$label}:</font></b> {$fieldValue['value']}</span>
    </div>
    {{endif}}
    {{endforeach}}
</div>

ibecnie.png.7102c88d4334ce2c6c49327c15290217.png

Field with a hyperlink, the URL is the URL prefix but disappears "Aktualny nick:"

<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 == 'akt_nick'}}
        <span class="cTemplateField_value"><a href="{$fieldValue['value']}">{$fieldValue['value']}</a></span>
        {{else}}
        <span class="cTemplateField_value"><b><font color="#38aaff">{$item->$label}:</font></b> {$fieldValue['value']}</span>
        {{endif}}
    </div>
    {{endif}}
    {{endforeach}}
</div>

ibecniee.png.b974536820722175322e0e30c5e3ab20.png

 

And here's how I add I have nothing:

ibecnieee.png.93cd3c4d677b11a49e676804efd971bb.png

 

And my point is that one response was seen only for admin and had hyperlink URL

Posted
On 2/7/2017 at 3:08 PM, HeadStand said:

I definitely need more information. When you say "my site goes down", what does that mean? Is there an error message? Frontend, ACP, or both? Anything in the php error logs?

Obviously I'm not having that problem and no one else has reported that either, so I haven't a clue until I get more details.

 

Untitled.thumb.png.45e83dc69c0c4cce62007f3ea7db2fc1.png

This is the error message I get. It happens when I load the page, and when I go into the AdminCP Forum tab.

Posted
32 minutes ago, B507 Admin said:

Untitled.thumb.png.45e83dc69c0c4cce62007f3ea7db2fc1.png

This is the error message I get. It happens when I load the page, and when I go into the AdminCP Forum tab.

Did you get the latest from the Marketplace? This should have been fixed yesterday.

Posted
On 8.02.2017 at 5:09 PM, Maniutek said:

Now:


<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"><b><font color="#38aaff">{$item->$label}:</font></b> {$fieldValue['value']}</span>
    </div>
    {{endif}}
    {{endforeach}}
</div>

ibecnie.png.7102c88d4334ce2c6c49327c15290217.png

Field with a hyperlink, the URL is the URL prefix but disappears "Aktualny nick:"


<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 == 'akt_nick'}}
        <span class="cTemplateField_value"><a href="{$fieldValue['value']}">{$fieldValue['value']}</a></span>
        {{else}}
        <span class="cTemplateField_value"><b><font color="#38aaff">{$item->$label}:</font></b> {$fieldValue['value']}</span>
        {{endif}}
    </div>
    {{endif}}
    {{endforeach}}
</div>

ibecniee.png.b974536820722175322e0e30c5e3ab20.png

 

And here's how I add I have nothing:

ibecnieee.png.93cd3c4d677b11a49e676804efd971bb.png

 

And my point is that one response was seen only for admin and had hyperlink URL

Hm?

Posted
3 hours ago, Maniutek said:

Hm?

There's clearly something going on with your template logic, but it looks fine to me. If you want to give me ACP access, I can troubleshoot, but there isn't much I can do from here.

Posted

I bought it, installed and working with no issues, thanks! Well there is one little issue, not sure if it's a bug...

When I create a new topic with template fields and then merge it with another topic, the information entered into the fields don't merger along with the post to the new topic. Is there a way to make this happen?

Thanks!

 

Posted (edited)

Hi,

I love this application, this is just what i need for my community, however I'm having some issues with it.

If, for example, i've got fields added to a Calendar template, the sets aren't showing until i change the Calendar that the entry is going in to.  The box which normally displays the Set name is just blank and disabled.  Once i change the Calendar, (even if i select a different one and then the original one again), then the dropdown box which displays the Set name becomes enabled and selects the default set for that Calendar's container.

Please see example in this link:  https://ozclubbers.com.au/calendar/submit/?do=submit&id=9

Thanks

Adam

 

2017-02-28 10_38_37-Submit an event - OzClubbers.jpg

Edited by Adam_S
Posted (edited)
1 hour ago, Adam_S said:

Hi,

I love this application, this is just what i need for my community, however I'm having some issues with it.

If, for example, i've got fields added to a Calendar template, the sets aren't showing until i change the Calendar that the entry is going in to.  The box which normally displays the Set name is just blank and disabled.  Once i change the Calendar, (even if i select a different one and then the original one again), then the dropdown box which displays the Set name becomes enabled and selects the default set for that Calendar's container.

Please see example in this link:  https://ozclubbers.com.au/calendar/submit/?do=submit&id=9

Thanks

Adam

 

2017-02-28 10_38_37-Submit an event - OzClubbers.jpg

There's actually no way around that. Logically speaking, until you select a calendar, I have no idea which sets should be available or if you should have a set at all. Some calendars will have one set, some will have another, others will have none. It would be worse for the user to choose a set that is unrelated to the calendar, only to have it disabled  (and ignored) after entering data into the fields.

Edited by HeadStand
Posted (edited)
12 minutes ago, HeadStand said:

There's actually no way around that. Logically speaking, until you select a calendar, I have no idea which sets should be available or if you should have a set at all. Some calendars will have one set, some will have another, others will have none. It would be worse for the user to choose a set that is unrelated to the calendar, only to have it disabled  (and ignored) after entering data into the fields.

Each of my calendars only have one set anyway.  And the calendar is already selected, but it still is greyed out.  Is it possible to at least let it select the default set and display that?

Edited by Adam_S
Posted
12 hours ago, Adam_S said:

Each of my calendars only have one set anyway.  And the calendar is already selected, but it still is greyed out.  Is it possible to at least let it select the default set and display that?

If the calendar is already selected, that's a bug. I'll look into it, but it may not be for a couple of days. 

Posted
16 hours ago, Adam_S said:

Each of my calendars only have one set anyway.  And the calendar is already selected, but it still is greyed out.  Is it possible to at least let it select the default set and display that?

I can't reproduce this issue. If I go to the create screen with a calendar selected, the set dropdown is not disabled. If a default set is defined, it is properly selected. I have tested this with 2 calendars, each with one set configured (a different one for each calendar). I have tried with a default set defined and not defined. I have tried with a set required and not required. All tests are successful.

Do you have any JavaScript errors in your console?

Posted
On 2017-02-21 at 4:30 PM, openfire said:

I bought it, installed and working with no issues, thanks! Well there is one little issue, not sure if it's a bug...

When I create a new topic with template fields and then merge it with another topic, the information entered into the fields don't merger along with the post to the new topic. Is there a way to make this happen?

Thanks!

 

Any idea about merged topics losing the info from the fields?

Posted
13 hours ago, HeadStand said:

I can't reproduce this issue. If I go to the create screen with a calendar selected, the set dropdown is not disabled. If a default set is defined, it is properly selected. I have tested this with 2 calendars, each with one set configured (a different one for each calendar). I have tried with a default set defined and not defined. I have tried with a set required and not required. All tests are successful.

Do you have any JavaScript errors in your console?

I'll check tomorrow and let you know

Posted
On 3/5/2017 at 4:47 AM, User2016 said:

Hello,

You can create required fields to create a new topic and that the data are entered in the general list of topics?

The image is of vbulletin with the following mod:

Https://modernvb.com/vb_products.php?vb_products=moreinfo&productid=14

Https://www.youtube.com/watch?v=SvnS4ZRe3QU

Is it possible to do this with your mod?

In my case I manage the inventory of a store with forum.

 

Right now the templates are only visible on the topic itself, and not on the listing pages. It's something I've been meaning to do, but haven't had the chance yet. It will be a couple more weeks until I can get that in there.

On 2/28/2017 at 10:32 PM, openfire said:

Any idea about merged topics losing the info from the fields?

It's not lost. It just doesn't work that way. The fields are not actually stored with the post, they're stored with the topic. I make them display after the post, but they're not part of that content.

In theory, if you merge a topic, I could just drop that template info in with the post content, but when the post is edited, it would be one long block of text. No individual fields.

  • Recently Browsing   0 members

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