<<O>>  Difference Topic NewsApplication (3 - 13 Feb 2009 - Main.AdminUser)
 

NewsApplication Usage

To Add the news application to any topic, you can use the following TML:

  • %INCLUDE{"System.NewsApplication"}%
News items can be filtered by category - to set this, change the INCLUDE to

  • %INCLUDE{"System.NewsApplication" CATEGORY="finance"}%
to display News Items from all categories:

  • %INCLUDE{"System.NewsApplication" CATEGORY="*"}%

urlparams

  • ?showfrom and ?showto - dates to filter output between
  • ?category - same as CATEGORY filter above
  • ?item=FoswikiApplicationData.NewsApplication123 - edit this item inline in the table.

NewsApplicationGroup

If you define the NewsApplicationGroup? group, they will be the only users that can add new news Items.

Application definition

Latest Aug 2010 Jul 2010 Jun 2010 May 2010 Apr 2010

Latest News


view item format

%STARTSECTION{"view_item"}%| \
    %FORMFIELD{"Date" topic="%ITEM%"}% |\
%FORMFIELD{"Message" topic="%ITEM%"}% %FORMFIELD{"Link" topic="%ITEM%"}% | \
 %INCLUDE{
   "%WEB%.%TOPIC%"
    section="%IF{"
                '%ITEM%' allows 'CHANGE' AND
                context authenticated AND
                    NOT ((istopic '%USERSWEB%.%TOPIC%Group') AND (NOT '%WIKINAME%' ingroup '%TOPIC%Group'))
         " then="edit_button" else="nothing"}%"
    warn="off"
}% |%ENDSECTION{"view_item"}%

edit_button

%STARTSECTION{"edit_button"}%[[%SCRIPTURL{view}%/%BASEWEB%/%BASETOPIC%?item=%ITEM%;showfrom=%URLPARAM{"showfrom" default=""}%;showto=%URLPARAM{"showto" default=""}%][%ICON{uweb-bo}%]]  [[%ITEM%][details]]  %ENDSECTION{"edit_button"}%

edit item format

%STARTSECTION{"edit_item"}%| %STARTFORM{
    name="%TOPIC%%BASETOPIC%%CATEGORY%"
    action="save"
    topic="%IF{"defined 'ITEM'" then="%ITEM%" else="%IF{"defined STOREIN" then="%STOREIN%" else="FoswikiApplicationData"}%.%TOPIC%AUTOINC0000"}%"
    method="POST"
    redirectto="%BASEWEB%.%BASETOPIC%"
    sep=" "
    showerrors="off"
}% %IF{"defined 'ITEM'" then="Edit" else="New"}% Item | %FORMELEMENT{
    mandatory="on"
    format="<span class='formTitle'> $t </span><span class='formValue'>  $e $m $h </span>%BR%"
    default="%FORMFIELD{"Date" topic="%ITEM%" alttext="%DISPLAYTIME{"$day $month $year"}%"}%"
    type="date"
    dateformat="%e %b %Y"
    name="Date"
    title="Date Posted"
    size="16"
}% %FORMELEMENT{
    mandatory="on"
    format="<span class='formTitle'> $t </span><span class='formValue'>  $e $m $h </span> %BR%"
    default="%FORMFIELD{"Expiry" topic="%ITEM%" alttext="%DISPLAYTIME{"$day $month $year"}%"}%"
    type="date"
    dateformat="%e %b %Y"
    name="Expiry"
    title="Expiry date"
    size="16"
}% %FORMELEMENT{
    mandatory="on"
    format="<span class='formTitle'> $t </span><span class='formValue'>  $e $m $h </span>%BR%"
    default="%FORMFIELD{"Message" topic="%ITEM%" alttext=""}%"
    type="text"
    name="Message"
    title="Message"
    size="70"
}% %FORMELEMENT{
    format="<span class='formTitle'> $t </span><span class='formValue'>  $e $m $h </span>%BR%"
    default="%FORMFIELD{"Link" topic="%ITEM%" alttext=""}%"
    type="text"
    name="Link"
    title="Link"
    size="70"
}% \
%FORMELEMENT{type="hidden" name="Show" default="%FORMFIELD{"Show" topic="%ITEM%" alttext="show"}%"}% \
%FORMELEMENT{type="hidden" name="Category" default="%FORMFIELD{"Category" topic="%ITEM%" alttext="%CATEGORY%"}%"}% \
%FORMELEMENT{type="hidden" name="formtemplate" default="%WEB%.%TOPIC%"}% \
%FORMELEMENT{type="hidden" name="topicparent" default="%BASEWEB%.%BASETOPIC%"}% \
%FORMELEMENT{type="hidden" name="%IF{"defined 'ITEM'" then="item" else="nothingtoseehere"}%" default="%ITEM%"}% \
%FORMERROR{"%TOPIC%%BASETOPIC%%CATEGORY%"}%  | %FORMELEMENT{
    type="submit"
    buttonlabel="Submit"
}% \
%IF{"defined 'ITEM'" then="<a class='foswikiButton foswikiCancelButton' href='%SCRIPTURL{view}%/%BASEWEB%/%BASETOPIC%'>Cancel</a>" else=""}% \
%ENDFORM% |%ENDSECTION{"edit_item"}%

widget-news

Side bar widget for WidgetsSkin
  • EDIT="WEB.EditTopic" - set to the topic that the users to to manipulate these news Items, defaults to the System web's NewsApplication (which will lose STOREIN and CATEGORY defaults)
  • LIMIT="2" to show that number of the latest news.
Changed:
<
<
>
>
 

Latest News

DataForm? definition

Name Type Size Values Tooltip message Attributes
Date date 16   05 Sep 2010 m
Message text 64     m
Link text 64   blah blah...  
Show checkbox 1 show    
Expiry date 16   05 Oct 2010 m
Category text 64    

Defaults for this topic only

  • Set CATEGORY=*

  • Set TINYMCEPLUGIN_DISABLE=1

 <<O>>  Difference Topic NewsApplication (2 - 13 Feb 2009 - Main.AdminUser)
 

NewsApplication Usage

Changed:
<
<
To Add the news application to any topic, you can use the following TML:
>
>
To Add the news application to any topic, you can use the following TML:
 
  • %INCLUDE{"System.NewsApplication"}%
Changed:
<
<
>
>
News items can be filtered by category - to set this, change the INCLUDE to
Deleted:
<
<
News items can be filtered by category - to set this, change the INCLUDE to
 
  • %INCLUDE{"System.NewsApplication" CATEGORY="finance"}%
Deleted:
<
<
 to display News Items from all categories:

  • %INCLUDE{"System.NewsApplication" CATEGORY="*"}%

urlparams

  • ?showfrom and ?showto - dates to filter output between
  • ?category - same as CATEGORY filter above
  • ?item=FoswikiApplicationData.NewsApplication123 - edit this item inline in the table.
Changed:
<
<
>
>
 

NewsApplicationGroup

Changed:
<
<
If you define the NewsApplicationGroup? group, they will be the only users that can add new news Items.
>
>
If you define the NewsApplicationGroup? group, they will be the only users that can add new news Items.
 

Application definition

Deleted:
<
<
 
Changed:
<
<

Latest News

>
>
Latest Aug 2010 Jul 2010 Jun 2010 May 2010 Apr 2010
Deleted:
<
<
 
Changed:
<
<
>
>

Latest News

Added:
>
>

 %SEARCH{
Changed:
<
<
web="FoswikiApplicationData" topic="NewsApplication*" "form.name~'System.NewsApplication' AND fields[name='Show'].value = 'show' AND fields[name='Category'].value ~ '*' AND ( ( '' = '' AND d2n(fields[name='Expiry'].value) >= d2n('05 Sep 2010') ) OR ('' = '' AND d2n(fields[name='Date'].value) >= d2n('') AND d2n(fields[name='Date'].value) < d2n('') ) )" type="query" nonoise="on" order="formfield(Date)" header="| Date Posted | Message | ** |" format="$percntINCLUDE{ $quotSystem.NewsApplication$quot nosection=$quotview_item$quot ITEM=$quot$web.$topic$quot section=$quot$percntIF{$quot'$web.$topic' = $item$quot then=$quotedit_item$quot else=$quotview_item$quot}$percnt$quot }$percnt"
>
>
web="FoswikiApplicationData" topic="NewsApplication*" "form.name~'System.NewsApplication' AND fields[name='Show'].value = 'show' AND fields[name='Category'].value ~ '*' AND ( ( '' = '' AND d2n(fields[name='Expiry'].value) >= d2n('05 Sep 2010') ) OR ('' = '' AND d2n(fields[name='Date'].value) >= d2n('') AND d2n(fields[name='Date'].value) < d2n('') ) )" type="query" nonoise="on" order="formfield(Date)" header="| Date Posted | Message | ** |" format="$percntINCLUDE{ $quotSystem.NewsApplication$quot nosection=$quotview_item$quot ITEM=$quot$web.$topic$quot section=$quot$percntIF{$quot'$web.$topic' = $item$quot then=$quotedit_item$quot else=$quotview_item$quot}$percnt$quot }$percnt"
 }% %INCLUDE{
Changed:
<
<
"System.NewsApplication" warn="off" section="nothing" }%
>
>
"System.NewsApplication" warn="off" section="nothing" }%
 


Added:
>
>
 

view item format

Changed:
<
<
>
>
 
     
Changed:
<
<

edit_button

%STARTSECTION{"edit_button"}%[[%SCRIPTURL{view}%/%BASEWEB%/%BASETOPIC%?item=%ITEM%;showfrom=%URLPARAM{"showfrom" default=""}%;showto=%URLPARAM{"showto" default=""}%][%ICON{uweb-bo}%]] %ENDSECTION{"edit_button"}%
>
>

edit_button

%STARTSECTION{"edit_button"}%[[%SCRIPTURL{view}%/%BASEWEB%/%BASETOPIC%?item=%ITEM%;showfrom=%URLPARAM{"showfrom" default=""}%;showto=%URLPARAM{"showto" default=""}%][%ICON{uweb-bo}%]]  [[%ITEM%][details]]  %ENDSECTION{"edit_button"}%
 

edit item format

Changed:
<
<
>
>
 
<--FormPlugin form start-->
New Item
Date Posted *
Expiry date *
Message *
Link

<--/FormPlugin form end-->

widget-news

Changed:
<
<
Side bar widget for WidgetsSkin
>
>
Side bar widget for WidgetsSkin
 
  • EDIT="WEB.EditTopic" - set to the topic that the users to to manipulate these news Items, defaults to the System web's NewsApplication (which will lose STOREIN and CATEGORY defaults)
  • LIMIT="2" to show that number of the latest news.
%STARTSECTION{"widget-news"}%<div class="widget-archives widget latnews">
%IF{"
    (NOT context authenticated) OR
    (NOT '%IF{"defined STOREIN" then="%STOREIN%" else="FoswikiApplicationData"}%.NoTopicWithThisName' allows 'CHANGE') OR
    ((istopic '%USERSWEB%.%TOPIC%Group') AND (NOT '%WIKINAME%' ingroup '%TOPIC%Group'))
   " 
   then="" 
   else="<div class='newsApplicationEditLink'>[[%IF{"defined EDIT" then="%EDIT%" else="%WEB%.%TOPIC%"}%][edit]]</div>"
Changed:
<
<
}%

Latest News

>
>
}%

Latest News

 

DataForm? definition

Name Type Size Values Tooltip message Attributes
Changed:
<
<
Date date 16   05 Sep 2010 m
Message text 64     m
Link text 64   blah blah...  
>
>
Date date 16   05 Sep 2010 m
Message text 64     m
Link text 64   blah blah...  
 
Show checkbox 1 show    
Changed:
<
<
Expiry date 16   05 Oct 2010 m
>
>
Expiry date 16   05 Oct 2010 m
 
Category text 64    

Defaults for this topic only

  • Set CATEGORY=*
Added:
>
>
  • Set TINYMCEPLUGIN_DISABLE=1
 

 <<O>>  Difference Topic NewsApplication (1 - 13 Feb 2009 - Main.AdminUser)
 

NewsApplication Usage

To Add the news application to any topic, you can use the following TML:

  • %INCLUDE{"System.NewsApplication"}%

News items can be filtered by category - to set this, change the INCLUDE to

  • %INCLUDE{"System.NewsApplication" CATEGORY="finance"}%

to display News Items from all categories:

  • %INCLUDE{"System.NewsApplication" CATEGORY="*"}%

urlparams

  • ?showfrom and ?showto - dates to filter output between
  • ?category - same as CATEGORY filter above
  • ?item=FoswikiApplicationData.NewsApplication123 - edit this item inline in the table.

NewsApplicationGroup

If you define the NewsApplicationGroup? group, they will be the only users that can add new news Items.

Application definition

Latest News


view item format

%STARTSECTION{"view_item"}%| \
    %FORMFIELD{"Date" topic="%ITEM%"}% |\
%FORMFIELD{"Message" topic="%ITEM%"}% %FORMFIELD{"Link" topic="%ITEM%"}% | \
 %INCLUDE{
   "%WEB%.%TOPIC%"
    section="%IF{"
                '%ITEM%' allows 'CHANGE' AND
                context authenticated AND
                    NOT ((istopic '%USERSWEB%.%TOPIC%Group') AND (NOT '%WIKINAME%' ingroup '%TOPIC%Group'))
         " then="edit_button" else="nothing"}%"
    warn="off"
}% |%ENDSECTION{"view_item"}%

edit_button

%STARTSECTION{"edit_button"}%[[%SCRIPTURL{view}%/%BASEWEB%/%BASETOPIC%?item=%ITEM%;showfrom=%URLPARAM{"showfrom" default=""}%;showto=%URLPARAM{"showto" default=""}%][%ICON{uweb-bo}%]] %ENDSECTION{"edit_button"}%

edit item format

%STARTSECTION{"edit_item"}%| %STARTFORM{
    name="%TOPIC%%BASETOPIC%%CATEGORY%"
    action="save"
    topic="%IF{"defined 'ITEM'" then="%ITEM%" else="%IF{"defined STOREIN" then="%STOREIN%" else="FoswikiApplicationData"}%.%TOPIC%AUTOINC0000"}%"
    method="POST"
    redirectto="%BASEWEB%.%BASETOPIC%"
    sep=" "
    showerrors="off"
}% %IF{"defined 'ITEM'" then="Edit" else="New"}% Item | %FORMELEMENT{
    mandatory="on"
    format="<span class='formTitle'> $t </span><span class='formValue'>  $e $m $h </span>%BR%"
    default="%FORMFIELD{"Date" topic="%ITEM%" alttext="%DISPLAYTIME{"$day $month $year"}%"}%"
    type="date"
    dateformat="%e %b %Y"
    name="Date"
    title="Date Posted"
    size="16"
}% %FORMELEMENT{
    mandatory="on"
    format="<span class='formTitle'> $t </span><span class='formValue'>  $e $m $h </span> %BR%"
    default="%FORMFIELD{"Expiry" topic="%ITEM%" alttext="%DISPLAYTIME{"$day $month $year"}%"}%"
    type="date"
    dateformat="%e %b %Y"
    name="Expiry"
    title="Expiry date"
    size="16"
}% %FORMELEMENT{
    mandatory="on"
    format="<span class='formTitle'> $t </span><span class='formValue'>  $e $m $h </span>%BR%"
    default="%FORMFIELD{"Message" topic="%ITEM%" alttext=""}%"
    type="text"
    name="Message"
    title="Message"
    size="70"
}% %FORMELEMENT{
    format="<span class='formTitle'> $t </span><span class='formValue'>  $e $m $h </span>%BR%"
    default="%FORMFIELD{"Link" topic="%ITEM%" alttext=""}%"
    type="text"
    name="Link"
    title="Link"
    size="70"
}% \
%FORMELEMENT{type="hidden" name="Show" default="%FORMFIELD{"Show" topic="%ITEM%" alttext="show"}%"}% \
%FORMELEMENT{type="hidden" name="Category" default="%FORMFIELD{"Category" topic="%ITEM%" alttext="%CATEGORY%"}%"}% \
%FORMELEMENT{type="hidden" name="formtemplate" default="%WEB%.%TOPIC%"}% \
%FORMELEMENT{type="hidden" name="topicparent" default="%BASEWEB%.%BASETOPIC%"}% \
%FORMELEMENT{type="hidden" name="%IF{"defined 'ITEM'" then="item" else="nothingtoseehere"}%" default="%ITEM%"}% \
%FORMERROR{"%TOPIC%%BASETOPIC%%CATEGORY%"}%  | %FORMELEMENT{
    type="submit"
    buttonlabel="Submit"
}% \
%IF{"defined 'ITEM'" then="<a class='foswikiButton foswikiCancelButton' href='%SCRIPTURL{view}%/%BASEWEB%/%BASETOPIC%'>Cancel</a>" else=""}% \
%ENDFORM% |%ENDSECTION{"edit_item"}%

widget-news

Side bar widget for WidgetsSkin
  • EDIT="WEB.EditTopic" - set to the topic that the users to to manipulate these news Items, defaults to the System web's NewsApplication (which will lose STOREIN and CATEGORY defaults)
  • LIMIT="2" to show that number of the latest news.
%STARTSECTION{"widget-news"}%<div class="widget-archives widget latnews">
%IF{"
    (NOT context authenticated) OR
    (NOT '%IF{"defined STOREIN" then="%STOREIN%" else="FoswikiApplicationData"}%.NoTopicWithThisName' allows 'CHANGE') OR
    ((istopic '%USERSWEB%.%TOPIC%Group') AND (NOT '%WIKINAME%' ingroup '%TOPIC%Group'))
   " 
   then="" 
   else="<div class='newsApplicationEditLink'>[[%IF{"defined EDIT" then="%EDIT%" else="%WEB%.%TOPIC%"}%][edit]]</div>"
}%   <h2 class="widget-header">Latest News</h2>
   <div class="widget-content">
%SEARCH{
    web="%IF{"defined STOREIN" then="%STOREIN%" else="FoswikiApplicationData"}%"
    topic="%TOPIC%*"
    "form.name~'%WEB%.%TOPIC%' AND 
    fields[name='Show'].value = 'show' AND
    fields[name='Category'].value ~ '%URLPARAM{"category" default="%CATEGORY%"}%' AND
    ( d2n(fields[name='Expiry'].value) >= d2n('%DATE%') ) "
    type="query"
    nonoise="on"
    order="formfield(Date)"
    limit="%IF{"defined LIMIT" then="%LIMIT%" else="2"}%"
    format="<div class='widget-news-item'>$formfield(Message) ... <div class='readMore'>[[$web.$topic][read more]]</div></div>"
}% 
  </div>
</div>%ENDSECTION{"widget-news"}%

DataForm? definition

Name Type Size Values Tooltip message Attributes
Date date 16   05 Sep 2010 m
Message text 64     m
Link text 64   blah blah...  
Show checkbox 1 show    
Expiry date 16   05 Oct 2010 m
Category text 64    

Defaults for this topic only

  • Set CATEGORY=*



ViewHistory: r3 < r2 < r1More



ViewHistory: r3 < r2 < r1More

Latest News

Testimonials

contact

  • phone +61 (2) 90116967

  • office Suite 2019,
    Level 20 Darling Park,
    201 Sussex Street Sydney,
    NSW 2000

  • post GPO Box 695
    Potts Point, NSW 1335