HOW TO add module shortcodes to the page?

Discuss everything related to ApPHP Durecty CMF. All versions. Any questions related to the Directy CMF developing or using should be posted to this forum.

Moderators: alexandrleonenko, alexmst

administrator
Site Admin
Site Admin
Posts: 6169
Joined: Jan 7th, '09, 23:18
Contact:

HOW TO add module shortcodes to the page?

Postby administrator » May 11th, '16, 14:57

The Directy CMF allows developers to create and use module shortcodes.

Module shortcodes - is a small tag used in pages content that will be replaced with some HTML/JS code on Frontent.
Generally, it's intended to be used on CMS pages, but it also may be used directly in view files.

All available module shortcodes may be viewed in add/edit mode of CMS pages (requires CMS module installed).
See this on the picture:
1.png
1.png (40.8 KiB) Viewed 5829 times


After running the code on Frontend this shortcut will be replaced with following:
2.png
2.png (62.73 KiB) Viewed 5830 times


You may also add this shortcode directly in yuor view page.
For example:

Code: Select all

<?
echo FaqComponent::drawShortcode();
?>

paragate
Master
Master
Posts: 151
Joined: Nov 13th, '14, 13:04
Location: Denmark, Odense

Re: HOW TO add module shortcodes to the page?

Postby paragate » Sep 7th, '16, 12:44

I have installed CMF262 and cms, gallery,events, faq modules. Wonder How come that when i write {module:faq} in the editor on a page side
only the {module:faq} is shown on the oage not the actually faq

ne_moj
Master
Master
Posts: 243
Joined: Jan 1st, '16, 14:11

Re: HOW TO add module shortcodes to the page?

Postby ne_moj » Sep 7th, '16, 20:17

Hello

Check that you have in your protected/modules/faq/config/main.php file spelled out all the necessary classes:

Code: Select all

...
    // module classes
    'classes' => array(
        'FaqComponent',
        'FaqCategories',
        'FaqCategoryItems',
        'FaqCategoryView'
    ),
...


Regards

antman313
Newbie
Newbie
Posts: 1
Joined: Jan 27th, '20, 17:10

Re: HOW TO add module shortcodes to the page?

Postby antman313 » Jan 27th, '20, 17:19

Did you something changed?
Get this errors, if I try to include it:

Fatal error: Cannot declare class Modules\News\Components\NewsComponent, because the name is already in use in /protected/modules/news/components/NewsComponent.php on line 0

second try on my own template:

Fatal error: Uncaught Error: Class 'NewsComponent' not found in
templates/cleantemp/default.php:103 Stack trace: #0
templates/framework/core/CView.php(314): include() #1
/protected/modules/cms/controllers/PagesController.php(492): CView->render('pages/view') #2 /framework/core/CController.php(49): Modules\Cms\Controllers\PagesController->viewAction() #3 /framework/core/CRouter.php(233): CController->execute('viewAction', Array) #4
/framework/Apphp.php(544): CRouter->route() #5 /home/chrisang/dev.fragandy.com/framework/Apphp.php(304): A->_runApp() #6
/index.php(24): A->run() #7 {main} thrown in /templates/cleantemp/default.php on line 103

administrator
Site Admin
Site Admin
Posts: 6169
Joined: Jan 7th, '09, 23:18
Contact:

Re: HOW TO add module shortcodes to the page?

Postby administrator » Jan 27th, '20, 20:01

Please refer such questions to our support and explain them what the script and version you use.


Return to “ApPHP Directy CMF {developers/users}”