Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Add ability to specify custom links without code update #67

Open
schlos opened this issue Jan 1, 2020 · 0 comments
Open

Add ability to specify custom links without code update #67

schlos opened this issue Jan 1, 2020 · 0 comments
Assignees

Comments

@schlos
Copy link
Member

schlos commented Jan 1, 2020

Path: _parent/html-templates/resources.tpl

Add ability to specify custom links without code update by using Staff editable content block.

Pseudo code:

{extends designs/site.tpl}

{block title}{_ Resources} — {$dwoo.parent}{/block}

{block content}
<div class="row">
    <div class="col-sm-10 col-sm-offset-1 col-md-8 col-md-offset-2">
        <div class="page-header">
            <h1>{_ Resources}</h1>
        </div>

        <ul>
            {include includes/site.resourcelinks.tpl}
        </ul>

        <ul>
            {contentBlock "custom-resources-list"}
        </ul>
    </div>
</div>
{/block}

Or add additional custom resources per user levels (Staff & Logged in Users):

{extends designs/site.tpl}

{block title}{_ Resources} &mdash; {$dwoo.parent}{/block}

{block content}
<div class="row">
    <div class="col-sm-10 col-sm-offset-1 col-md-8 col-md-offset-2">
        <div class="page-header">
            <h1>{_ Resources}</h1>
        </div>

        <h2>{_ "Generic Resources"}</h2>
        <ul>
            {include includes/site.resourcelinks.tpl}
        </ul>

        {* Add custom resources list using Staff Markdown page editor box *}
        <div>
            <p>{contentBlock "custom-resources-list"}</p>
        </div>

        {* Add custom resources list for Staff using Staff Markdown page editor box *}
        {if $.User->hasAccountLevel('Staff')}
        <div class="alert alert-danger">
            <h2>{_ "Staff Resources"}</h2>
            {contentBlock "staff-resources-list"}
        </div>
        {/if}

        {* Add custom resources list for Logged in Users using Staff Markdown page editor box *}
        {if $.User->hasAccountLevel('User')}
        <div class="alert alert-success">
            <h2>{_ "Members Resources"}</h2>
            {contentBlock "members-resources-list"}
        </div>
        {/if}

    </div>
</div>
{/block}
@schlos schlos self-assigned this Jan 1, 2020
@schlos schlos transferred this issue from codeforcroatia/laddr Nov 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant