Support Tickets - CMS 1.4.2- custom template for plugin

CMS 1.4.2- custom template for plugin

CMS 27.11.2015 2763 Feedback Status: Closed Solution: Yes bluesatkv


Hi Jerome,

How can I use custom template for plugin e.g. FAQ or Blog?

In template folder in plugin (FAQ or Blog) are some files. I can edit this files or can I create new folder with custom template files?

Thanks for your support.


Replies (5)

  • avatar Jerome

    Thank you for opening a support ticket.

    Each plugin has his own template directory. You can edit the files of course, however I would suggest to adapt the classes used for the plugin in your new template/stylesheet.

    For example the blog plugin, to show blog posts we have used following code:

    <!-- Post -->
    <div class="col-md-4 col-sm-6">
    <div class="jak-post">
    <!-- Post Info -->
    <div class="post-info">
    <?php if ($v["showdate"]) { ?>
    <div class="post-date">
    <div class="date"><?php echo $v["created"];?></div>
    </div>
    <?php } ?>
    <div class="post-comments-count">
    <i class="fa fa-eye"></i> <?php echo $tl["general"]["g13"].$v["hits"];?>
    </div>
    </div>
    <!-- End Post Info -->
    <!-- Post Image -->
    <a href="<?php echo $v["parseurl"];?>"><img src="<?php echo BASE_URL.$v["previmg"];?>" alt="blog-preview" class="post-image img-fluid"></a>
    <!-- End Post Image -->
    <!-- Post Title & Summary -->
    <div class="post-title">
    <h3><a href="<?php echo $v["parseurl"];?>"><?php echo jak_cut_text($v["title"],30,"");?></a></h3>
    </div>
    <div class="post-summary">
    <p><?php echo $v["contentshort"];?></p>
    </div>
    <!-- End Post Title & Summary -->
    <div class="post-more">
    <a href="<?php echo $v["parseurl"];?>" class="btn btn-primary btn-small"><?php echo $tl["general"]["g3"];?></a>
    <?php if (JAK_ASACCESS) { ?>

    <a href="<?php echo BASE_URL;?>admin/index.php?p=blog&amp;sp=edit&amp;id=<?php echo $v["id"];?>" title="<?php echo $tl["general"]["g"];?>" class="btn btn-default jaktip"><i class="fa fa-pencil"></i></a>

    <a class="btn btn-default jaktip quickedit" href="<?php echo BASE_URL;?>admin/index.php?p=blog&amp;sp=quickedit&amp;id=<?php echo $v["id"];?>" title="<?php echo $tl["general"]["g176"];?>"><i class="fa fa-edit"></i></a>

    <?php } ?>
    </div>
    </div>
    </div>
    <!-- End Post -->

    You have two options now, you can either change the code and classes or the easier way would be rename the classes from your exisiting stylesheet to fit the code above, that way you can swap between templates without changing code again. The stylesheet from the jakweb template is commented through so you will find the connected classes from line 546.

    27.11.2015 0
  • avatar bluesatkv

    Many thanks. Close please.

    27.11.2015 0
  • avatar bluesatkv

    Jerome,

    I like your CMS laughing

    I have idea. It is possible created better system for plugin template. I think that your solution is more complicated.

    For example:

    It is possible created folder in template folder 'jakweb' where we can store all the templates plugins?

    28.11.2015 0
  • avatar Jerome

    That would be possible of course, but if someone want to create a new template he has to create a folder for each plugin for the the new template, otherwise the system does not work anymore.

    28.11.2015 0
  • avatar Jerome

    Will be implemented within CMS 1.5 thank you for your suggestion.

    *** Ticket closed ***

    28.11.2015 0