Page 1 of 1
Question News template
Posted: Wed Dec 13, 2017 9:29 pm
by rooon
Hi,
I'm building a fesubmit template in cmsms 2.2.3.1. In this template I changed the date/time input fields, see below. For some reason the "expiry" checkbox is checked after submitting the form.
Code: Select all
<div class="form-group rv-startdate hidden">
<input type="hidden" name="{$actionid}startdate_Year" value="{$smarty.now|cms_date_format:'Y'}" />
<input type="hidden" name="{$actionid}startdate_Month" value="{$smarty.now|cms_date_format:'m'}" />
<input type="hidden" name="{$actionid}startdate_Day" value="{$smarty.now|cms_date_format:'d'}" />
<input type="hidden" name="{$actionid}startdate_Hour" value="00" />
<input type="hidden" name="{$actionid}startdate_Minute" value="00" />
<input type="hidden" name="{$actionid}startdate_Second" value="00" />
</div>
I did the same for
name="{$actionid}enddate_.... and the end date is stored as expected.
My question: How can I uncheck the expiry checkbox through the fesubmit template?
Any hint or solution?
Thanx. Ronald
Re: Question News template
Posted: Sat Dec 16, 2017 12:58 pm
by velden
Quickly checked the code and I think the following happens:
- fesubmit sets and enddate if you like it or not; either by using input from form or else it will use a default from a preference or - if that doesn't exist - 180 days hard coded
- if an enddate exists (and fesubmitted articles always have it) it makes sense to enable the expiry, which it does.
Re: Question News template
Posted: Sat Dec 16, 2017 3:11 pm
by rooon
The nice thing of the News module is that it can be used for several other things, not only for news articles. On the
http://www.voeteninzicht.nl/producten/j ... rries-body website of my customer I use it for reviews and a simple product showcase. For this it is strange that the checkbox is optional in the backend but required if using the fesubmit form. Is this something for the dev team to change in the next version? I think the News module will be more flexible that way.
Greetz, Ronald
Note: in my fesubmit template I removed all enddate inputs. It is not a problem that the enddate always have a value. It is the checkbox that is checked by default if using the form.
Note: for other users: in the default fesubmit template there is no
{elseif $field->type == 'dropdown'} in the foreach loop.
Re: Question News template
Posted: Tue Dec 19, 2017 4:00 pm
by paulbaker
Slightly off topic: Interesting use of News module there. But consider also using Products which is a custom built module to display products with prices etc. and optional add-to-cart functionality:
http://dev.cmsmadesimple.org/projects/products
Also for (arguably) even more flexibility consider LISE, a way of listing anything in various templates:
http://dev.cmsmadesimple.org/projects/lise
Re: Question News template
Posted: Tue Dec 19, 2017 7:36 pm
by rooon
True, I could use other modules to show products and reviews on the website. For example, on another website I used CGFeedback for reviews.
For a simple price and description the Products module has many dependecies where the News module has none. That's why I used the News module.
My first question... All the News fields, except the checkbox, can be used in the fesubmit template. Why not adding...
Code: Select all
<div class="row">
<p class="col4"><label for="news_use_enddate">{$mod->Lang('enddate')}?</label></p>
<p class="col8"><input id="news_use_enddate" type="checkbox" name="{$actionid}use_enddate" value="{$use_enddate}" /></p>
</div>
...so we are free to use the end date (or not). Usage: if the checkbox is not in the submitted form then the backend settings will be used.
Offtopic:
Before, a customer asked me for a simple webshop with minimal features. In The Netherlands the comination of Products, Cart2 and Orders (with other req. modules) was somehow buggy. And there was no Gateway to the
www.mollie.nl API for iDEAL payments. At the end I used Prestashop which was hard to learn for me and my customer. But I will try the shop modules again in cmsms2 and if it works I may try to build a module for the
Mollie php API
Re: Question News template
Posted: Tue Dec 19, 2017 10:54 pm
by calguy1000
The FESubmit feature of news has long been deprecated... will receive no new features.
Only reason we haven't removed it completely is because we have not yet written an API so that somebody else can write a replacement.