Joss Posted July 29, 2014 Posted July 29, 2014 Ryan's Hanna Code module is a seriously useful bit of kit, not just for blog type systems where you want to insert a gallery or something clever, but for business websites where consistent branding and messaging is paramount. Lack of consistency can do a surprising amount of damage to a brand - if the way you refer to a company is inconsistent or unusual, for instance, you can confuse the visitor or split your messaging. Likewise, important messaging statements (keyword phrases in SEO), need to be kept consistent and current. It is all a bit obvious really, but it is amazing how easy it is to get wrong. And if phrases or contact info or even the company name changes, then trying to update the site with hundreds, perhaps thousands of pages could be a nightmare. Using the Hanna Code Module creatively, but very simply, can save you a lot of heartache and keep things on track. This is probably the simplest use of the module since all you doing is using it as a text replacement rather than for entering complex code. If you have created some sort of central settings page in your page tree that is for global values like Site Name, or main background image or whatever, consider adding a bunch of simple text fields for things like: Company Phone Number Company Name Company email address CEO's name Small company logo (that would be a single image field, of course) Company slogan Then, using the Hanna Code Module, set up hanna codes to retrieve this information. For instance, create a hanna code called "company" Set it for php, save and then under code, add the following: <?php echo $pages->get("/settings/")->company_name; Here I have assumed you have a hidden page as a child of your home page called "settings" and that the field for you company name is called company_name. Now, add the Hanna Code text formatter to every field that you may need to use it in. Within those fields, [[company]] will now be replaced with the company name. If the way the company name is written changes at any point, then it will be changed in all text. While you are about it, you can retrieve the same field without the hanna code module directly into templates where required. Now the company name throughout the entire site is consistent and is controlled by one simple field on a settings page. All you need do is take a very large rock to any authors who do not use it! Branding is important, more important than pretty pictures, clever JQuery, responsiveness and even SEO. Giving the client controls so that their carefully worked out brand values are not just used, but used consistently and without errors throughout their site, should be all part of the service, and Hanna Codes give you that. And for small clients who have not quite got their heads round the idea of building a brand, it may help them think about it more carefully. 11
DaveP Posted July 29, 2014 Posted July 29, 2014 Very good points, Joss. One of the arms of the company I work for sells advertising, in just 3 standard sizes, each size having a price, and I did the same as you mention above with those sizes & prices, so each mention across the site can be updated in one place. Bonus Suggestion - (along similar lines) One thing I have been doing recently is, in /site/config.php, declare $config->siteName = 'Your Site Name Here'; and then I can use that variable anywhere in the site (navbar brand, meta title etc.etc.). Save typing and ensures consistency. (And makes standard boilerplate site profiles easier.) 3
Joss Posted July 29, 2014 Author Posted July 29, 2014 The other useful think you can use it for (though a bit more dangerous from the layout point of view) is have a contact panel. So everytime they type [[contactus]] it creates a panel or popup or something with all contact details, contact form, chat link, or whatever. I must admit I haven't used config.php for that sort of thing, mostly because the client does not have access to it - that can cut both ways, of course
cstevensjr Posted July 29, 2014 Posted July 29, 2014 A very good and much needed tutorial. There are so many different and great uses for the technology that has been created within the ProcessWire community.
mr-fan Posted July 29, 2014 Posted July 29, 2014 This is a great conzept of using Hanna Code with Pages...another thing that would work the same way... A Kind of Glossary: Pages: /glossar/ (or name it tags) --phrase one (Title, Url, Description for tooltip or something else, maybe some pagefield for cathegories) --phrase two --phrase three didn't tested but should work. For acronyms, tooltips and simple Contenttags just to use in every contentblock/article/topic that it is needed!! Thats a whole taggingsystem with just one snippet Thanks for sharing this basic idea!
Raymond Geerts Posted July 29, 2014 Posted July 29, 2014 In our company site i'm using Hanna code all over the place for company phone and fax numbers and e-mail addresses. Its very easy to manage when a value needs to be changed. Change it once in the hanna code and ~voila~ its changed site wide Some examples usages in our site: (translated to english for these examples) [[phone nr="marketing"]] [[fax nr="sales"]] [[email address="subscriptions"]] 7
mr-fan Posted August 12, 2014 Posted August 12, 2014 Just pinning this CKEditor Addon here that fits for some of the mentioned usecases: http://ckeditor.com/addon/strinsert https://github.com/57u/custom-dropdown-ckeditor4/blob/master/README.md you could define your own list of strings for insert in CKE - so you could setup the predefined HannaCodes for the customer to just only select the right one.... regards mr-fan 1
adrian Posted August 12, 2014 Posted August 12, 2014 Or you could use teppo's awesome Hanna Code Helper: http://modules.processwire.com/modules/hanna-code-helper/ 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now