how can i theme a specipc element that created by node form? i saw mytheme_checkbox etc but i want to do phoneselect_theme() { } and change there the value or whatever
You should be able to use the Theme Developer module to find which function or template file is outputting the part of the page you're interested in theming. Theme Developer will also tell you what "suggestions" you can use to override the output. Check out the Theme Developer screencast for an introduction on how to use the module.
Implement a form alter hook in your module, and then use the #theme attribute inside the alter hook to override the form element's theming.
You'll want to know the exact form ID of your form. This writeup by Lullabot will tell you how to find the form ID and it will give you an example of how to modify forms.
Don't forget to register your new theming function using the theme hook.
Related
I have a Wordpress website and want to add custom flow of registration.
The current website has these pages but I am not sure if there is any plugin that has inbuilt such flow feature or how to add this feature.
Any help appreciated.
I had to do a similar modification.
Your case seems the same as mine, its a single form, split onto steps for helping users/validations.
I didn't found any plugin ready for all i needed (the steps thing), and mainly ... hooks to change registration form in wordpress just add extra fields to standard fields, i needed to completly remix the order, so I went the javascript way:
Added my custom css and JS to login/register pages with the action 'login_enqueue_scripts'
Added my custom fields to form using 'register_form' action
Added a class to login body with 'login_body_class' filter, to keep things hidden while JS magic happened;
I'm not sure what's your skill level in JS, but once you got those hooks ready you can make pretty much whatever you want with the register form.
Is it possible with SilverStripe 3 to create a default email template/style which is applied to all sent emails, without have to to override each email template separately?
Ideally this could be done as part of a theme.
I've tried defining a custom GenericEmail.ss template but it's been ignored thus far.
Looking at the framework source, creating a custom Email class and overriding the parseVariables() could possibly achieve it, but it seems like overkill?
After trying just now, the default email template can effectively be overriden with a custom one. I put mine under the "templates" folder of my theme (and not in any subfolder), ie
/themes/mytheme/templates/GenericEmail.ss
Then tested after a flush=1 (so that the new template is picked up)
Hope this helps
I have a form in tpl files and called the tpl in wordpress theme.so now the form is submitted to the theme file.
Can anyone tell me which way is the proper way for wordpress?
1.Getting the post values and pass the value to custom plugin function to process the db functionality.
2.Getting the post values and Process the db functionality in theme itself .
3.form action directly to the custom plugin function.
Thanks
Technically the best thing to do is to write a plugin that will also provide the template(you can of course allow the theme a way of overriding that - for instance by using locate_template( 'my-plugin-template.php' ) to check if the template exists in the current theme).
You should then process the form submission in your plugin - I would either check for the form values on the template_redirect action filter for instance(you can do it earlier as well - like on init for instance), or even right before loading the template if you don't need to do a redirect.
The idea behind using a plugin, vs putting all of the code in the theme is that if you decide to change your theme in the future, it would be more easy to keep the same functionality in the new theme as well.
I personally try to avoid calling plugin files directly(the third option you thought of) - not that it has any side-effects that I know of, but it's just my own preference.
I'm using Drupal 7, and have the Advanced Forum module installed.
However, I want to show some Ubercart products in one section of the forum, called the Marketplace to make them more visible, and since users will be able to add their own products.
However, obviously in this section I want to show the forum topic list differently, including the price and other such fields.
Is there an easy way that I'd be able to do this, perhaps using Views? I'm really at a loss for what to do.
You should be able to just create a new View with a page display that displays things like you want them and then set the URL for the view to be the URL that is currently being used for the forum listing you want to override, so that the links to it still work without any additional work.
First of all, you should override the page template for one specific term by creating a new page like so:
page__forum_TERMID
To go more into details about what you need to show in this custom page, you may need to install the Devel & Theme Developer modules.
With Theme developer you will be able to inspect your Drupal output on various parts of the page in order to find out either which preprocess function or which template it originates from.
With Devel you will be able to output some of the variables you may need to act upon in order to generate your custom layout.
I would advise you to look at the implementation of the [Advanced Forum More Styles](http://drupal.org/project/advanced_forum_more_styles) in order to see how you could create your own Advanced Forum Style, which basically means a folder where you can store the various custom templates that will override the Advanced Forum templates.
Recently, I did something similar to what you're looking to achieve, I created a custom module to hold the various preprocess functions and that module contained a styles folder which was declared like so:
function YOURMODULENAME_ctools_plugin_directory($module, $plugin) {
if ($module == 'advanced_forum') {
return 'styles';
}
}
If you look at the styles in the AF module, you will see that they only override a few templates, so you may have to find the template you're looking for in the base style such as the "Naked" style.
d6 there is no module that i just can change the variables like $mycckfied[options]=array() or unset($title);
its mass to do each field type a theme function and hack it by mytheme_options or whatever...
hook_form_alter() - will allow you to make a great number of changes to the form before it's sent to the theme layer. Here is more info on how form generation works in Drupal, and how you can modify the output of forms.