Neu Create custom plugin

Osama

Neues Mitglied
7. Mai 2021
2
0
I am trying to create multi contact form plugin and and i am using shop version 5 i have some questions
how can i create custom page for each contact form from my plugin (i need to create page for each form saved to my database)
and can i create short-code to display forms in exists page (Like wordpress)
thanks in advance
 

artm

Sehr aktives Mitglied
22. Februar 2021
107
27
I would just create a single front page with plugin and a load these forms dynamically instead.
 

artm

Sehr aktives Mitglied
22. Februar 2021
107
27

You add front page by editing plugin configuration file.

Example:
XML:
<FrontendLink>
    <Link>
        <Filename>myform.php</Filename>
        <Name>MyForm</Name>
        <FullscreenTemplate>myform.tpl</FullscreenTemplate>
        <VisibleAfterLogin>N</VisibleAfterLogin>
        <PrintButton>N</PrintButton>
        <LinkLanguage iso="ENG">
            <Seo>seoEng</Seo>
            <Name>nameGerEng</Name>
            <Title>Title</Title>
            <MetaTitle>MetaTitle</MetaTitle>
            <MetaKeywords>MetaKeywords</MetaKeywords>
            <MetaDescription>MetaDescription</MetaDescription>
        </LinkLanguage>
        <LinkLanguage iso="GER">
            <Seo>seoGer</Seo>
            <Name>nameGer</Name>
            <Title>Titel</Title>
            <MetaTitle>MetaTitle</MetaTitle>
            <MetaKeywords>MetaKeywords</MetaKeywords>
            <MetaDescription>MetaDescription</MetaDescription>
        </LinkLanguage>
    </Link>
</FrontendLink>

You also need to create both "myform.php" and "myform.tpl" files.
You will find more information on official guide page here:
https://jtl-devguide.readthedocs.io...test/shop_plugins/infoxml.html#frontend-links

Then you need to make sure you can reach the page via seo name. I suggest you check demo or other released plugins by jtl software.

Form class offers you some very basic functions, including token validation, captcha validation and flood protection:
https://gitlab.com/jtl-software/jtl-shop/core/-/blob/master/includes/src/Helpers/Form.php

How you build the form depends on your skills, either you build it extremely plain and simple like "kontakt.php" or you build how you wish, with custom or 3rd party libraries.
 
  • Gefällt mir
Reaktionen: janw

Ähnliche Themen