Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Converting Themeable functoin to templates, Drupal 7

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 112
    Comment on it


    The final option is the creation of individual template files that are dedicated to overriding specific themable functions. This could be very helpful for the designer as PHP developer have done his work and designer now can do this XHTML and css work with it independently this is the major advantage of this technique.


    Converting a function into a new template file gives both frontend and backend developer more flexibility than simply modifying the function inside the template.php file.


    steps are as follows

    1. Create a new .tpl.php file inside your theme directory.
    2. Name the new file by taking the function name, dropping the prefix, and changing the underscores to dashes/hyphens. For example, the function theme_comment_view would become the template comment-view.tpl.php.
    3. Paste into the new file the code from the function that relates to the formatting and the output.
    4. Make your changes to the file's code.
    5. Save the file.
    6. Clear the Theme Registry.


    Best Resource to understand is here About overriding themeable output


    Please visit related Theming Blogs

    1. Overriding the Default Styling
    2. Overriding Theme functions

    Thanks

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: