Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Ergänzung in "How to work with articles in modules"

What is an article?

Excerpt
An article is actually the page of the website and belongs to one client.

 

An article is actually the page of the website. article is a client ressource.

Article id's

...

Important article IDs

IDDescription
idartidart is the article identifier for the client .in all languages
idartlangis the client article identifier for dirrerent languages .(available through table art_lang)
idcatartis the relation id from category to article (available througt table cat_art)

The tables are referenced by foreign key relation (see below).

 

How to

...

work with articles in modules

The usage is very simple. You can load single or multiple article objects by using article respectively article collectionthe article Item or ItemCollection instances or you can use the cArticleCollector class - in previous versions of CONTENIDO formerly known as "ArticleCollection".

To see all possible loading and object handling methods, take a look on Item or ItemCollection classes.

With set and get methods you can change all table properties and the store it like in example below.

Code Block
languagephp
linenumberstrue
// load language independent article by Item or ItemCollection
$idart = 1;
$article = new cApiArticle($idart);
$articleCol = new cApiArticleCollection();
$article = $articleCol->loadItem($idart);

// load language dependent article by Item or ItemCollection
$idartLang = 1;
$artLang = new cApiArticleLanguage($idartLang);
$artLangCol$artLangColl = new cApiArticleLanguageCollection();
$artLang = $artLangCol$artLangColl->loadItem($idartLang);

//or if no idartlang is available:
$obj = new cApiArticleLanguage();
$obj->loadByArticleAndLanguageId($idart, $lang);
$msgText $artLang= $obj->set>getContent("onlineCMS_HTMLHEAD", 1);
// set online state
$artLang->get>set("online", 1);
$artLang->store();

// get online state
$artLang->get("online");

Article states

Articlelanguage object has Language dependent articles have some important states which are commom used during development. These states are stored in the databae table art_lang.

StateDescription
onlineIf article is online, it can be reached from frontend.
Example: Its It is important if you generate link to article or doing something else, you should check that article is online, otherwise it won't be found and you will be redirected to the home or error page
publishedIf article is published it can be reached from frontend
lockedIf article is locked, it can't be accessed or changed from other users in CONTENIDO backend
start articleStart article will be shown in frontend, when idart in the url is not set, so it is start article in category
searchableIf article is searchable, it can be found through CONTENIDO search
redirectIf redirect is active, browser will follow the redirection url instead of loading current article

Furthermore, an article can be defined as a start article of a category. If set so, it will be displayed if the category is accessed without any article information. The ID of the language dependent article as a start article for a category is defined in cat_lang.startidartlang.