Question News template

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
rooon
Forum Members
Forum Members
Posts: 113
Joined: Mon Dec 05, 2011 4:40 pm
Location: Nederland

Question News template

Post 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
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3484
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: Question News template

Post 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.
rooon
Forum Members
Forum Members
Posts: 113
Joined: Mon Dec 05, 2011 4:40 pm
Location: Nederland

Re: Question News template

Post 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.
User avatar
paulbaker
Dev Team Member
Dev Team Member
Posts: 1465
Joined: Sat Apr 18, 2009 10:09 pm
Location: Maidenhead, UK
Contact:

Re: Question News template

Post 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
To copy System Information to the forum:
https://docs.cmsmadesimple.org/troubles ... nformation

CMS Made Simple Geekmoots attended:
Nottingham, UK 2012 | Ghent, Belgium 2015 | Leicester, UK 2016
rooon
Forum Members
Forum Members
Posts: 113
Joined: Mon Dec 05, 2011 4:40 pm
Location: Nederland

Re: Question News template

Post 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
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Question News template

Post 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.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Locked

Return to “CMSMS Core”