I have used Drupal 7 for a while, but am only starting to learn to use the tpl and template.php files. As you would expect, I have become good friends with the documentation, but am still having trouble putting all the pieces together at times.
One thing that I have not figured out how to do, but seems pretty basic, is to create a function in template.php or a custom tpl file (not sure what I need as well as how to do it) that outputs HTML. Let me explain what I mean…
I have created a custom node–content-type.tpl.php. In there, I have put the following code in to replace the normal submitted by information:
<?php if ($ display_submitted): ?> <div class="submitted"> <div class="created"> <span>Created by <?php print $ node->name; ?> on <?php print format_date($ node->created, $ type = 'medium'); ?>.</span> </div> <div class="revised"> <span>Last revised by <?php print (user_load($ node->revision_uid)->name); ?> on <?php print format_date($ node->changed, $ type = 'medium'); ?>.</span> </div> </div> <?php endif; ?>
I am trying to figure out how to reuse this code in some of my other custom node tpl files without simply cutting and pasting it in. I am obviously missing something basic. How can I go about doing this?
✓ Extra quality
ExtraProxies brings the best proxy quality for you with our private and reliable proxies
✓ Extra anonymity
Top level of anonymity and 100% safe proxies – this is what you get with every proxy package
✓ Extra speed
1,ooo mb/s proxy servers speed – we are way better than others – just enjoy our proxies!
USA proxy location
We offer premium quality USA private proxies – the most essential proxies you can ever want from USA
99,9% servers uptime
No usage restrictions
Perfect for SEO
We are working 24/7 to bring the best proxy experience for you – we are glad to help and assist you!