Saggad Dashti
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    **Database model** URL :: https://blauwhuis.d02.fidela.net/exo_admin/#/formgroup/0/forms The design dictates what database model is needed. For our example website blauwhuis.d02.fidela.net they are listed below with their description: * container: Used to store general collections of reacts. * systemurl: Used to create frontend shortcuts in sidebar (e.g. New Page) * contact: Form to collect information from visitors. * review: Form to collect reviews shown randomly. * page_block: Form used for blocks with sub-templates (e.g. reviews) * page: Form for page (header-image, text, related page_blocks) * mail-template: Form used to mail owner and visitor. **Assigning the main HTML & CSS template to an edition** URL :: https://blauwhuis.d02.fidela.net/exo_admin/#/editions/363 Main template in most cases consists of a header and footer part (example url here later) because these parts don't change througout a website. For the middle section seperate blocks are created using the form [page_block](https://blauwhuis.d02.fidela.net/exo_admin/#/formgroup/0/forms/885/) which can be reused throughout the website. In the edition two templates are set. A main HTML template and a main CSS template. These two templates are extracted from [static HTML & CSS](https://blauwhuis.d02.fidela.net/sites/blauwhuis/public/index.html) ![](https://i.imgur.com/oqd4S8S.png) **Creating routes** Path: /config/routes.php Basic routes: ![](https://i.imgur.com/NcQogeH.png) **Creating startpage based on page react** **Header picture** Header picture is set as inline background-image style. Image source we get from current page react. ``` <header style="background-image: radial-gradient(circle, rgba(13, 45, 108, 0.5), rgba(1, 152, 217, 0.5)), url('<?=$page['react']->getHeaderImage()->getURL()?>');" exedit="{type:react,id:<?=$page['id']?>,field:header_image,contenttype:file}"> ``` **Defining the page_blocks for startpage** Between header and footer we include pageblocks.php **%%FD(tmpl=pageblocks.php)%%** In this file we set pageblocks container and output template for each pageblock. ``` <? /** pageblocks.php */ /** get page alias from url by parameter 'alias' which is set in routes.php */ $p_alias = $exolog->request->getGet('alias'); /** initialize formdata request */ $query = fd()->form('page'); /** if no alias - get startpage. else get page react by alias */ if(!$p_alias) { $query = $query->where('startpage','1','LIKE'); } else { $query = $query->where('alias',$p_alias,'LIKE'); } $current_page = $query->fetch(); /** get page react container where page blocks stored */ $pageblock_container = $exolog->getContainer(array('react_id' => $current_page['react_id'], 'field_prefix' => 'pageblock')); /** get page blocks reacts */ $pageblocks = $pageblock_container->getItemsTree(); /** class="ee-item" <?=$pageblock_container->getExeditAttr()?> this line creates controller for container */ ?> <div class="ee-item" <?=$pageblock_container->getExeditAttr()?>> <? /** output blocks templates */ foreach($pageblocks as $pageblock) { ?> %%FD(tmpl=<?=$pageblock['react']['template']?> &block=<?=$pageblock['id']?>)%% <? } ?> </div> ``` Startpage has three page_blocks between header and footer in middle section: *First page_block react* ![](https://i.imgur.com/ioSHd10.png) *Second pageblock react* ![](https://i.imgur.com/S4pNFSl.png) *Third pageblock react* ![](https://i.imgur.com/E4JGoNI.png) Once we created pageblocks.php, we need to declare different page blocks. For doing so we will create reactions for the form page_block. In reactions we will use template field for assigning template php files. Like this: ![](https://i.imgur.com/hFJMQ7V.png) Here we can also assign more than just a php file. We can put text and images. For creating the template php files, first of all we need to declare the right form. Using something like this: ``` <? $block = fd()->form('page_block')->where('react_id',$params['block'])->fetch(); $items_container = $exolog->getContainer(array('react_id' => $block['react_id'],'field_prefix' => 'related')); $items = $items_container->getItemsTree(); ?> ``` Here we will have our form and also container and items declared. Then we can process stuff within the code. For _Second pageblock react_ is something like this: ``` <div class="about"> <div class="about__image"> <? echo $block->getPicture()->render(['src'=>'435w376h90q1c','type'=>'image/webp']); ?> <span class=""></span> </div> <div class="about__text"> <div exedit="{type:react,id:<?=$block['react_id']?>,field:text,contenttype:tinymce,toolbar:custom}"> <?=$block['text']?> </div> <div class=" ee-item" <?=$items_container->getExeditAttr()?>> <? foreach($items as $item) { ?> <div exedit="{type:react,id:<?=$item['id']?>,field:menu_intro,contenttype:tinymce,toolbar:custom}"> <?=$item['react']['menu_intro']?> </div> <a href="<?=$item['react']['permalink']?>" exedit="{type:react,id:<?=$item['id']?>,field:menu_link,contenttype:tinymce,toolbar:custom}"><?=$item['react']['menu_link']?></a> <? } ?> </div> </div> </div> ``` Here in code we have a part for having the image. Using ``` <? echo $block->getPicture()->render(['src'=>'435w376h90q1c','type'=>'image/webp']); ?> ``` we can have access to the image in the reaction of the form. ![](https://i.imgur.com/weVRY3E.png) The same thing for the text. Using ``` <div exedit="{type:react,id:<?=$block['react_id']?>,field:text,contenttype:tinymce,toolbar:custom}"> <?=$block['text']?> </div> ``` We will have access to the text in the reaction of the form. ![](https://i.imgur.com/wPa6Tmh.png) **Creating a loop** If something is going to be repeated over and over, we can create a loop. For example in [this page](https://blauwhuis.d02.fidela.net/diensten), the items are repeated and only images and the text is changing. Using _foreach_ we can easily create a loop. _foreach_ simply do the block of code for every part of the array. like this: ``` <? $block = fd()->form('page_block')->where('react_id',$params['block'])->fetch(); $page = fd()->form('page')->where('react_id',$params['page_id'])->fetch(); $items_container = $exolog->getContainer(array('react_id' => $page['react_id'],'field_prefix' => 'related')); $items = $items_container->getItemsTree(); ?> <div class="services ee-item" <?=$items_container->getExeditAttr()?>> <? foreach($items as $item) { ?> <div class="services__item"> <div class="services__image"> <? echo $item['react']->getPageIcon()->render(['src'=>'96w96h90q1c','type'=>'image/webp']);?> <span exedit="{type:react,id:<?=$item['id']?>,field:menu_title,contenttype:tinymce,toolbar:custom}"><?=$item['react']['menu_title']?></span> </div> <div class="services__text"> <h3 exedit="{type:react,id:<?=$item['id']?>,field:title,contenttype:tinymce,toolbar:custom}"><?=$item['react']['title']?></h3> <p exedit="{type:react,id:<?=$item['id']?>,field:menu_intro,contenttype:tinymce,toolbar:custom}"><?=$item['react']['menu_intro']?></p> <a href="<?=$item['react']['permalink']?>">LEES MEER OVER VERZEKERINGEN »</a> </div> </div> <? } ?> </div> ``` Here the items will be repeated and we don't need to have all of them here. ```$items``` is our array and then we have our value as ```$item```. The array itself (the content of every element of the array) can be created and edited in the front-end editor. ![](https://i.imgur.com/5RKCGEq.png) Here you can add as many elements as you want just by clicking on add icon and choosing _Add new item_. ![](https://i.imgur.com/t2hdoUV.png) Here you choose the Edition and the form for entering the values of the reaction. Here the form is _page_. And as you can see in the code at the first lines, we have the form _page_ declarted. ``` $page = fd()->form('page')->where('react_id',$params['page_id'])->fetch(); ``` And then we can add different stuff using the form _page_. The image is something like this: ``` <? echo $item['react']->getPageIcon()->render(['src'=>'96w96h90q1c','type'=>'image/webp']);?> ``` It is using the input of _PAGE_ICON_ of the form _page_ ![](https://i.imgur.com/Ri6YJ0V.png) For the title below the icon we have this: ``` <span exedit="{type:react,id:<?=$item['id']?>,field:menu_title,contenttype:tinymce,toolbar:custom}"><?=$item['react']['menu_title']?></span> ``` As you can see _menu_title_ is declared. So the title will be the input of this in the form _page_. ![](https://i.imgur.com/9Ba2jKi.png) And the same for other texts and links. --- **Exolog forms** To output Exolog form we use form marker which can be stored in form field. ![](https://i.imgur.com/MNA81qq.png) After we output this field value on the page, form needs to be styled according to design because html structure of the form is determined by core form-template. Form maker helps us to show an Exolog form to the users. In the template, we use something like this for having it: ``` <?=$block['formmarker']?> ``` (`$block` here is our page_block form.) And then in page_block form, we can declare the form template and the form maker (image above). For the template of the form we have something like this: ``` <? $block = fd()->form('page_block')->where('react_id',$params['block'])->fetch(); $page = fd()->form('page')->where('react_id',$params['page_id'])->fetch(); $fd_var['header_class'] = 'header--contact'; ?> <div class="contact__main"> <div class="contact__form"> <?=$block['formmarker']?> </div> <div class="contact__sidebar"> <div class="" exedit="{type:form,id:887,field:contact_sidebar,contenttype:tinymce,toolbar:custom}"> %%F_VAR_CONTACT_SIDEBAR(form=887)%% </div> </div> </div> <div class="contact__notice"> <p exedit="{type:form,id:887,field:contact_grey,contenttype:tinymce,toolbar:custom}"> %%F_VAR_CONTACT_GREY(form=887)%% </p> <img src="/sites/blauwhuis/images/exclamation.svg" alt=""> </div> ``` Here for the information in the _contact__notice_ and _contact__sidebar_ we used variables. These variables are declared in the contact form. ![](https://i.imgur.com/P5RI5lr.png) **Styling the form** Because we are using forms of the Exolog core itself, we can't import our HTML/CSS for forms directly. But we can make our style easily. Once we created the form, we can use the inspect tool of the browser to see the class names of the form's elements. Using them in your stylesheet you can make your personalized style. Also, we can have a unique id for each element in the form. Those ids are declared in the form itself as a name. For example, here you can see: ![](https://i.imgur.com/CjQgmtd.png) Here we have _name_company_ for the name field. This is the id of the element. So you can use it to stylize this particular element. **Submitting a form** After the user clicked on submit, we can manage the action in the front-end editor. For the form in the front-end editor we have something like this: ![](https://i.imgur.com/TTR8wbZ.png) Here we can have several actions for the submit. Here we have three, one for sending an email to the admins (Breicht voor Blauwhuis), one for sending a confirmation email to the user (Breicht voor bezoeker), and one for redirection. Two of them are using the form mail-template where we have all the necessary fields for the email template. ![](https://i.imgur.com/A4leHP9.png) And then in action we can declare where those emails will be sent. (Using email fields) ![](https://i.imgur.com/IUqptmH.png) The action for the redirect part is also something like this: ![](https://i.imgur.com/Uf5bZXT.png) For the mail template, here we have mail_body field to enter the text. We can change it in the reactions to the mail_template form. ![](https://i.imgur.com/KbD2m5C.png) In the mailtemplate.html itself for having that part we only used this where we want our mail body: ``` %%RELATED_MAIL_BODY%% ``` In the start of mailtemplate we also included this: ``` %%SET_RELATED_MAIL_VARS%% ``` and then in the head element this: ``` <? if($exolog->authHandler->getValue(array('user','u_isadmin'))) { ?> %%INCLUDE(file=meta.html)%% <? } ?> ``` --- **Formats** Sometimes you need to have different formats in the front-end editor. For example on [this page](https://blauwhuis.d02.fidela.net/over-blauwhuis) for having the content of the page we need to have headings, paragraphs, quotes, and so on. For doing so we can have our formats/custom CSS. First of all for adding them you will go to the _Custom setting_. ![](https://i.imgur.com/htsk5dc.jpg) Here you can add fields of css and formats. Then you can define different formats in the custom css part. Something like this: ![](https://i.imgur.com/qutIoPq.jpg) Then we can have different formats. ![](https://i.imgur.com/i0WkKPG.jpg) --- **Changing the style of a repetitive part** A lot of parts like the header and footer will be repeated in all pages. But sometimes you need to have a small change in the style of them only for one page. So it can not be done within those blocks themself. Because the change will be applied to every page. One of the solutions is using `<style>` element within the `body`. For example in [this page](https://blauwhuis.d02.fidela.net/contact), the footer is not like every page. The top part should not be displayed. So one class name should be `display: none;` here but only for this page. ![](https://i.imgur.com/t34YqKO.jpg) The easiest way for doing so is to just add that `style` element to one of the page blocks of this specific page (here contact page). So the style will be applied only on this page. For example, in this case, we used the form of this page and added a variable and in the variable, we added the `style` code. In this way, we can edit it later easily. ![](https://i.imgur.com/ZyIeTsp.png) Here we created the variable _contact_footer_ with the style that we need.and then in the template of this form, we added this variable. ![](https://i.imgur.com/uGWBQBN.png)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully