Goto main content

sn_ct

Use to implement small text within pages.

SN_CT

NAME

sn_ct - Use to implement small text within pages.

DESCRIPTION

This function is use to implement small texts within pages. sn_ct use the table ct to save information unless the parameter ct define a different table.

Code nomenclature of CT

Widget name/resource + text of the ct

EXAMPLES

If the widget is called "offer_list" and the text "Cancel", then the ct code should be "offer_list_cancel".
{_{%include "/extenso/functions/sn_ct.snc";

sn_ct("offer_list Cancel", publish:"/extenso/publish/pages.sn", edit:true, uids:page.rows.uid, module:"contacts")}_}

Directory of publication

Check if the publication script (pages.sn, sn widget.sn ...) you will use is in the directory "/extenso/publish/" or in "/publish/" at the root.

Types of publication

1. Ct in a non published widget

Add once at the top of the page:

{_{ 
    %include "/extenso/functions/sn_ct.snc"; 
    use page;
}_}

Function call

{_{sn_ct("emploi_vedette Days remaning", publish:"/extenso/publish/pages.sn", edit:true, uids:page.rows.uid, module:"contacts")}_}

 

2. Ct in a published widget

Add once at the top of the page:

{_{
    %include "/extenso/functions/sn_ct.snc"; 
    use widget;  
}_}

Function call

{_{sn_ct("emploi_vedette Days remaning", publish:"/extenso/publish/sn_widgets.sn", edit:true, uids:widget.rows.uid, module:"contacts")}_}

 

3. Ct in email

Add once at the top of the page:

{_{
    %include "/extenso/functions/sn_ct.snc"; 
    use page;  
}_}

Function call

{_{sn_ct("email Days rue", publish:"/publish/email.sn", edit:true, uids:page.rows.uid, module:"contacts")}_}

 

4. Ct of a resource

Add once at the top of the page:

{_{
    %include "/extenso/functions/sn_ct.snc"; 
    use ressource;  
}_}

Function call

{_{sn_ct("email Days rue", publish:"/publish/ressources.sn", edit:true, uids:ressource.rows.uid, module:"contacts")}_}

CT and buttons

1. Input type button - put edit to false

<input type="button" class="button-print" value='{_{sn_ct("emploi_vedette Imprimer", publish:"/extenso/publish/pages.sn", edit:false, uids:page.rows.uid, module:"contacts")}_}’ />

2. Class button in a link - put edit to true

<a href="#" class="btn btn-primary btn-grey btn-rg full-width">{_{sn_ct("emploi_vedette Imprimer", publish:"/extenso/publish/pages.sn", edit:true, uids:page.rows.uid, module:"contacts")}_}</a>

Several CT in the same text

If we use several time the same ct in a gabarit (widget/resource/email), we use the same code not to duplicate the ct un the shared content table.

Add a pen on a page

1. Editing an item

By example, you want a pen towards the edition of an item on the mass_address table:

<div class="sn_pencil" data-sn_title1="Edit" data-sn_class1="edit" data-sn_link1="/extenso/extranet/mas_address//edit.snc?uid=\{_{etablissement.rows.uid}_}&sn_modal=t">  VOTRE HTML </div> 

2. A pen towards a list of items

<div class="sn_pencil" data-sn_title1="Edit" data-sn_class1="edit" data-sn_link1="/extenso/extranet/mas_address/{_{lg.rows.lg}_}/index.snc?sn_modal=t">  VOTRE HTML </div>

AUTHOR

Written by Pierre Laplante, <lapante@sednove.com>

VERSION

1.0 2014-05-12 laplante@sednove.com

1.1 2016-05-17 pascale@sednove.com

Edit

© 2024 extenso Inc. All rights reserved.