Jump to content

Joss

PW-Moderators
  • Posts

    2,862
  • Joined

  • Last visited

  • Days Won

    47

Everything posted by Joss

  1. Hi Reems Generally, I would think it a whole lot better to work with a more versatile slideshow script. I am assuming you are using one that creates a slideshow from the whatever is in a folder, but that is rather limiting. If you use a script where you simply list the images using the PW API with a foreach loop, then you can take advantage of being able to do things like change the order they appear in by changing the order of the images in the field. You can loop through the thumbnails (whether created by the cropimage module, or thumbnails created using the API on a normal images field) separately from the main images very easily. I must admit, I have not come across a script that just uses folder contents for a long, long time - I didn't think anyone wrote them like that anymore.
  2. An easier way is to use the video text formatter, I would have thought. http://modules.processwire.com/modules/textformatter-video-embed/ Edit: he beat me!
  3. 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
  4. 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.
  5. Yes, it can be like ten people round a table all trying to swat the same fly ..... fun though
  6. Worked for me! Though you need to post silly answers too....
  7. Starter - New Satchel Newbie - Pencil Sharpened Jr Member - Prep School Full Member - Terrible 4th sr Member - 6th Form Hero Members - Graduate Moderators - Prefects Admin - School Bully Edit: Sorry, this is very UK - possibly needs to be a bit more international for Terrible 4th (a St Trinians Reference) and 6th Form, which is the top years of UK secondary schools.
  8. It is rather easy to create your own. If your image requires a lot of info, then there is no reason why you cannot either just dedicate a page to each image or create a repeater field which includes an image field plus whatever else you wish. Just for interest, if you have been avoiding the usual directory structure, are you still able to take advantage of all the other powerful API bits that comes with the image field like resizing, cropping, caching and so on?
  9. I have to admit that I don't really take into account those who have javascript disabled (around 0.2%) I suspect that figure is misleading as it will include all those who disable for some ideological reason - from the marketing point of view, that grouping are not a very responsive target market for most clients Still, it is not as bad as one site I visited a few years ago - the site would not deliver the page I wanted because "I was using an OS by the devil Gates" I wonder how long that chaps face has been missing a nose.....
  10. Because of the powerful API allowing you to create sized versions on the fly which are then cached ( http://processwire.com/api/fieldtypes/images/ ) you can take advantage of swapping media using JQuery and media queries. Foundation 5 has a system built in for delivering dedicated content (including images and background images) based on media queries - http://foundation.zurb.com/docs/components/interchange.html However there is also http://responsejs.com/ which does the same thing and is standalone.
  11. And there was me thinking that New England was in the the US..... I wonder if they had some restart issues after the update?
  12. If you are using Chrome, check the console output to see if there are errors
  13. Yes I will - once it is finished and I am sure it is working (and that I can display the example)
  14. Joss

    My Processwire Desktop

    Okay, your PC is better than mine..... You are spending far too much time Studio Max (or something)
  15. I am having a lot of fun today (having worked out a game throttling kink with Soma last night - thanks mate) I have about 900 plus pages all about car manufacturers, models, servicing, prices and the rest. So what? Well, it is the way I have been able to put them together with PW and PHP So, I have a function that lists all the services like gearbox rebuilds, or body work repairs. On its own, on a normal page, it just links to the pages about those things. On a car manufacturer page it changes from Gearbox Rebuilds" to "Audi Gearbox Rebuilds" with an extra URL segment in the URL that adds /audi/ The function gets two extra arguments to work the magic: rightMenu($page->title,$page->name); Now on the gearbox rebuilds page it is suddenly all about Audi gearbox rebuilds with text changes all thanks to hanna code. Also on the manufacturer page it lists all the models for audi and gives servicing prices for each model. Prices are set globally (since most cars cost the same) but can be overridden individually if the client wants. Now I just need to add Ryans clever linking thingy for text and suddenly I will have everything cross linking all over the place. The Really, Really, Really amazing thing about this is that I have been able to code all this from scratch with so little knowledge that it is frightening, but there I am, staring at a 900 line functions file, stuffed with php and PW API, and I did it all. And it works! The reason is the API - to code this fully would be so overwhelming that I would not even consider it, assuming I even knew where to start. But the API wraps up so many complications is such brief statements, that suddenly it is not only easy, but clean, clear and understandable - even for an old has-been, burnt out, media bloke like me. The only down side is that the client is being so undercharged for this that it is criminal - but then, it is not his fault that I decided to get carried away and add 900 pages to his site.
  16. Joss

    Hanna Code

    Correction - the problem seems to have been with the title field also having the hanna code textformatter added. Er, I think. I need to go through this tomorrow!
  17. Joss

    Hanna Code

    Neither do I. One for Ryan when he is wandering by at some point. Interesting to see if you can replicate it though. Night!
  18. Joss

    Hanna Code

    BINGO! Soma, well done. It was the HTML entity encoder textformatter on the title field (I have no memory of adding that, but then this project started a while ago) Thanks mate, again.... Now the question is why would that mess things up?
  19. Joss

    Hanna Code

    I know - sorry. Jump on a plane?
  20. Joss

    Hanna Code

    OKAY!!! Ummmmm If I change it to get the page name, rather than the page title, it works!!! WHAT?? (Cache is very definitely off and this is just on a local box)
  21. Joss

    Hanna Code

    Okay, this getting very odd. I have changed it so that I am getting the text from a field on the actual page, rather than from another page. And it has exactly the same problem. ??
  22. Joss

    Hanna Code

    hmm ... so something is not right. With the other hanna code, the one that points to a telephone number, in test it shows the telephone number. I have tried deleting the hanna code instance, and adding a new one and it is the same problem. The only other thing is that they are on different tree levels - the page that has the text in it is a child of home, the other page, the Audi page, is its grandchild. But I dont think that should be a problem. I am a bit lost on this, to be honest, and it has brought the project to a shuddering halt
  23. Joss

    Hanna Code

    Do those two pages, the one you have the body field and the about page, use the same template? I just emptied the template file, but it still is not working properly. I noticed that when I save and test the hanna code, inside the dotted box it just says Hanna Code No idea why.
  24. Joss

    Hanna Code

    Damn! I wonder what I have got that is messing it up? I think I will strip the entire template out apart from the get line and see what happens
  25. Joss

    Hanna Code

    Sorry, Soma, I should have explained it better. I have a page called services that has a CKEditor field called service_model_default_text It contains, for instance, "we can service your [[model-name]]" The code for the [[model-name]] hanna code is <?php echo wire("page")->title; ?> I have the replace surrounding tag set to "no" and it is type PHP I have another page called Audi. In the template for that page I get the field from the services page. <?php echo $pages->get("/servicing/")->service_model_default_text; ?> The idea is that the hanna code is replace with the page title from the audi page so that the final result is: We can service your Audi. Unfortunately, the hanna code system does not seem to be able to do that, it prints out the page title fine, but not the rest of the text from the field. However, if I change the hanna code to another one I have, [[phonenumber]], which takes its input from a field on a completely separate page, it works fine. Confused!
×
×
  • Create New...