News Smart Object

N.B. This article refers to the legacy application Publish, used in versions below 8.1.
In modern versions, the Pages application has effectively replaced the need for Publish.
Continue reading if you are using Publish and wish to implement this smart object.

Please note that the image above is a generic representation of the smart object, and may not necessarily reflect the final product on your own intranet.

  Before proceeding, please read the overview of smart objects and components here.

Click here to download the source code. Switch to Source mode in CKeditor and paste in the code. The list can be controlled by modifying certain parameters.

<script type="text/javascript">
<!--
var smart_news_list = {}
smart_news_list.name="my_news";
smart_news_list.channels="1";
smart_news_list.tags=""
smart_news_list.columns="image,title,date,text";
smart_news_list.text_character_count="230";
smart_news_list.page_size="3";
smart_news_list.show_paging="0";
smart_news_list.current_page="1";
smart_news_list.link_new_window="1";
smart_news_list.width="1000";
smart_news_list.height="400";
smart_news_list.scrolling="auto";
smart_news_list.show_subscribed = 0;
smart_news_list.css_main_table="table_docs";
smart_news_list.css_paging_table="table_options";
//-->
</script><script type="text/javascript" src="/intranet/news/show_smartnews.js"></script>

 

Parameters

  • name: Object name must be unique among several objects within a content page. If only one smart object is used on a content page, the name can remain as it is.

  • channels: ID of news channel of which to show the contents. Separate IDs by commas. If not specified, mandatory and subscribed news channels are displayed.

  • tags: Defines which news articles to display, based on tags. Separate tags by commas. NB: Only news articles with all tags will be displayed, rather than any.

  • columns: Defines which columns to show (comma delimited list). Possible values are 'image','title','channel','owner','date','text'.

  • text_character_count: Defines number of characters to display of the abstract/summary text (0 = no constraint).

  • page_size: The number of elements on one page (-1 = show all elements).

  • show_paging: Defines whether or not to display pagination. Possible values are: 1, 0 (1 = yes, 0 = no).

  • current_page: Defines which page to display by default.

  • link_new_window: Opens link in new window. Possible values are: 1, 0 (1 = yes, 0 = no).

  • width: Frame width in pixels.

  • height: Frame height in pixels.

  • scrolling: Frame scrolling. Possible values are: auto, yes, no.

  • css_main_table = 'table_docs': This is the default CSS style used for the table structure. Do not change unless custom styling is being used.

  • css_paging_table = "table_options": This is the default CSS style used for the table options. Do not change unless custom styling is being used.

  page_size, show_paging, current_page are related, in the sense that modifying the value of one may have an affect on another.

Last modified on 17 August 2018 by Jon Mulhern
Created on 24 February 2013 by deleted user

Was this helpful?  

1 Like
Share