Section
All articles for an issue are retrieved. All sections where the articles belong are sorted.
This section discusses:
IScript_BuildSectionNavBar
IScript_GetSectionArticles
IScript_GetSectionImg
IScript_SectionArticleTemplate
Syntax
IScript_BuildSectionNavBar()
Description
IScript_BuildSectionNavBar builds the section navigation bar for a publication issue. The navigation bar displays all of the sections for a publication issue. It is created with the images that are defined in the section navigation (on and off) images of the application.
If the current section is referenced, the Section Navigation Bar On image is used. If the section referenced is not the current section, the Section Navigation Bar Off image is used.
The declaration is:
Declare Function IScript_BuildSectionNavBar PeopleCode WEBLIB_WEBPUB.EO_E_SECT
ION FieldFormula;
Parameters
Function Call Parameters: None.
This table lists Query String Parameters:
Parameter |
Description |
---|---|
PUB |
The publication ID is set in the query string by The function must have this query string parameter to retrieve the correct values from the database. This value is retrieved in the function and set to the variable &Publication. |
ISSUE |
The issue ID is set in the query string by The function must have this query string parameter to retrieve the correct values from the database. This value is retrieved in the function and set to the variable &Issue. |
SECTION |
The section ID is set in the query string by The function must have this query string parameter to retrieve the correct values from the database. This value is retrieved in the function and set to the variable &Section. |
Returns
Returns the HML markup for the entire section navigation bar.
Example
&HTMLNav2 = IScript_BuildSectionNavBar();
Syntax
IScript_GetSectionArticles(&NumberOfColumns, &Fontsize, &Se ctionOn, &CategoriesOn, &ArticlesSummaryOn, &More, &Section)
Description
IScript_GetSectionArticles displays all articles for a section of a publication issue. All articles are displayed; they use the parameters that are listed in the following table. The output of the articles can be changed.
Features include the number of columns in which the articles are displayed in, font size, section titles (on or off), category titles (on or off), article summaries (on or off), more articles link (on or off), and a section ID override.
The declaration is:
Declare Function IScript_GetSectionArticles PeopleCode WEBLIB_WEBPUB.EO_PE_SEC
TION FieldFormula;
Parameters
This table lists the Function Call Parameters:
Parameter |
Description |
---|---|
NumberOfColumns |
(Integer) Number of columns in which to display the articles. If this value is 3, three columns display the articles. |
Fontsize |
(Integer) Relative font size in which the output is displayed. |
SectionOn |
(Integer) If this value is 1 (true), the section name is displayed at the beginning of the article listing. If this value is 0 (false), the section name is not displayed. |
CategoriesOn |
(Integer) If this value is 1 (true), the category name is displayed at the beginning of each article. If the value is 0 (false), the category name is not displayed. |
ArticleSummaryOn |
(Integer) If this value is 1 (true), the article summary is displayed after the article title. If the value is 0 (false), the article summary is not displayed. |
More |
(Integer) If this value is 1 (true) and there are more than three articles, More... appears at the end of the article listing. If the value is 0 (false), the link does not appear. |
Section |
If a value exists, it overrides the query string parameter value for the section ID. This is useful if there is no query string parameter for the section ID. This value must be the section ID. |
This table lists the Query Sting Parameters:
Parameter |
Description |
---|---|
PUB |
The publication ID is set in the query string by The function must have this query string parameter to retrieve the correct values from the database. This value is retrieved in the function and set to the variable &Publication. |
ISSUE |
The issue ID is set in the query string by The function must have this query string parameter to retrieve the correct values from the database. This value is retrieved in the function and set to the variable &Issue. |
SECTION |
The section ID is set in the query string by The function must have this query string parameter to retrieve the correct values from the database. This value is retrieved in the function and set to the variable &Section. |
Returns
Returns the HTML markup for all articles in a section for a publication or an issue.
Example
rem Get the Articles for the news section;
rem Parameters Values for the Function Call;
rem Number of Columns - 1;
rem Font Size - 2;
rem Section Title On - 0 (False);
rem Category Title On - 0 (False);
rem Article Summary On - 1 (True);
rem More... link - 0 (False);
rem Section Name - "" (current section);
&HTMLText = IScript_GetSectionArticles(1, 2, 0, 0, 1, 0, " ");
Syntax
IScript_GetSectionImg()
Description
IScript_GetSectionImg retrieves the section image for a section of a publication. It accepts inputs from the query string for the publication ID and the section ID. IScript_GetSectionImg first retrieves the section image ID. Using this ID, it calls the IScript_GetImage function to retrieve the image information.
The declaration is:
Declare Function IScript_GetSectionImg PeopleCode WEBLIB_WEBPUB.EO_PE_SECTION F
ieldFormula;
Parameters
Function Call Parameters: None.
This table lists the Query String Parameters:
Parameter |
Description |
---|---|
PUB |
The publication ID is set in the query string by The function must have this query string parameter to retrieve the correct values from the database. This value is retrieved in the function and set to the variable &Publication. |
SECTION |
The section ID is set in the query string by The function must have this query string parameter to retrieve the correct values from the database. This value is retrieved in the function and set to the variable &Section. |
Returns
Returns the HTML image tag for the section image.
Example
&HTMLSectionImg = IScript_GetSectionImg();
Syntax
GetScriptContentURL(%Portal, %Node, Record.WEBLIB_WEBPUB, Field.EO_PE_TEMPLATES, "FieldFormula", "IScript_SectionArticleTemplate");
GenerateScriptPortalURL can be used with this function as part of the syntax, but generally the syntax for this iScript is the following:
IScript_SectionArticleTemplate
Description
IScript_SectionArticleTemplate assembles the section page for a publication issue. It uses the section built-in functions iScripts described previously to come up with each value that is required by the section page template. Passing all required parameters as bind variables, to the HTML Section Page template, assembles it.
Changes to the code are required when customizing section page layouts. For example, if the HTML template has six bind variables, IScript_SectionArticleTemplate must pass six values, including HTML markup returned by other section built-in functions, to match. Using examples from previous sections, we have:
&HTMLText = GetHTMLText(HTML.EO_PE_SECTIONTEMPLATE, &HTMLHeader, &HTMLNav1,
IScript_GetImageFileSpec("
PWSA19OE85C"), &HTMLNav2, &HTMLSectionImg, &HTMLBody, &HTMLFooter);
where:
EO_PE_SECTIONTEMPLATE is the section page layout.
&HTMLHeader, &HTMLNav1, &HTMLNav2, and &HTMLFooter contain the HTML markup for the header, publication navigation, section navigation, and footer portions of the layout.
&HTMLSectionImg contains the HTML markup for the section image; &HTMLBody contains the HTML markup for all articles for the current section.
IScript_GetImageFileSpec() calls are used to retrieve the image file path and file name from the database.
Note: If you have a different page layout for every section in a publication, you must edit IScript_SectionArticleTemplate to use the appropriate HTML object (section layout), depending on the publication section.
Parameters
None.
Returns
Returns the HTML markup for a section in a publication issue.
Example
<a href="http://jwegrzyn070500/psc/ps/EMPLOYEE/PSFT_PA/s/WEBLIB_WEBPUB.EO_PE_
TEMPLATES.FieldFormula.IScript_SectionArticleTemplate?PUB=PEOPLETALK&ISSUE=
JUNAUG2000&SECTION=NEWS">News</a>