Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to create my own shortcode? #16

Open
Sogl opened this issue Jul 13, 2016 · 6 comments
Open

How to create my own shortcode? #16

Sogl opened this issue Jul 13, 2016 · 6 comments

Comments

@Sogl
Copy link

Sogl commented Jul 13, 2016

Hello!

I want to use this plugin with another form/contact service.
But I don't know how to create my own shortcodes and in which folder I need to put them.

Can you provide a small instruction?

@rhukster
Copy link
Contributor

This plugin uses the Grav Shortcode Core plugin, and you can create your own shortcode plugins to work in parallel with any other (such as Gravstrap): https://github.com/getgrav/grav-plugin-shortcode-core/blob/develop/README.md#developing-shortcode-plugins

@giansi
Copy link
Owner

giansi commented Jul 16, 2016

@Sogl you can add a shortcode as @rhukster suggested, as Gravstrap does. This last one implements some shortcuts I will certainly talk about in some later instructions but, before that, I must revisit some parts of Gravstrap plugin which do not work as expected with Grav 1.1.

@Sogl
Copy link
Author

Sogl commented Jul 18, 2016

In which folder I need to put my new form?

@giansi
Copy link
Owner

giansi commented Jul 18, 2016

Hi,
under the templates folder of your theme could work, but it's better if you to create a new plugin to handle your new shortcodes and add the for under the plugin's template folder. However, just notice you don't need a shortcode to handle your form.

@Sogl
Copy link
Author

Sogl commented Jul 19, 2016

I'm trying to use Gravstrap theme, which fully builded with Gravstrap plugin. I need to change contact form in some parts and don't know where to put my own. Main contacts file lays here: \user\plugins\gravstrap\templates\vendor\simple_form.html.twig

So where I need to create my own and edited? I don't think that I need to put my file near the original.

@yaazkal
Copy link

yaazkal commented Nov 29, 2016

Hi @Sogl You can copy your /user/plugins/gravstrap/templates/vendor/simple_form.html.twig to /user/themes/**your_theme**/templates/vendor/simple_form.html.twig and edit/modify it as you want. Also you can get information about how to create/put elements to a form here: https://getsimpleform.com/

Remember to generate a token in https://getsimpleform.com/ and put it in your file when you are showing your form.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants