Jump to content

Joss

PW-Moderators
  • Posts

    2,862
  • Joined

  • Last visited

  • Days Won

    47

Everything posted by Joss

  1. Joss

    Hanna Code

    Basically I have a huge lump of default text in a separate page that is pulled into about 100 pages or so. The default text needs to pick up values from those pages - product name, price and so on - that will be part of that long default text. The page title is just one of those values. The easiest way I could see to do it (and easy for the client to understand) was to use bits of hanna code within the text.
  2. Joss

    Hanna Code

    Hi Soma, no, I have the replace bit turned off. I think it is because the textarea that supplies the text, complete with the hanna code reference, is originating on another page. I am calling it into my template with: <? echo $pages->get("/servicing/")->service_model_default_text; ?> Now, if I use a different code, one that pulls the info from a specified field in a specified page, that works fine. For instance, a code that is: echo "<span class='phonenumber'>Call {$pages->get("/settings/")->site_phone}</span>"; But if I try and call something from the current page, it goes wrong. So if I used the code: echo $page->title; Simply prints out title of the page where the text originated, but not the rest of the text. if I use wire() it prints out the current page title, but again no text. Debug is not showing errors.
  3. Joss

    Hanna Code

    ummm ... I am halfway there. by using this for the php for my hanna code <?php echo wire("page")->title; ?> I now get the current page title. However, I am not getting the rest of the text. So: This is my [[pagetitle]] you can see Is just printing out the page title, not the rest of the words.
  4. Joss

    Hanna Code

    I think I am getting caught out by scope - well, I know I am. I have some text on a page other than the one I am looking at, and I am drawing it in with get() That text has a hanna code in it that simply echos the page title. The problem is that it is echoing the page title of the page the code originates from and not from the page I am looking at. How do I do this so that it gets my current page title, not the page where the text originates from?
  5. Yep, that is what I am doing I am doing that with all relevant fields including meta description so if needed they can be overridden.
  6. Yes, I am not sure what to do about duplicate content, though I will put enough bits in the text that get replaced by the product or manufacturer name so it is not completely identical. In the end, the client simply cannot afford for me to write it all out manually. I suppose, If I were clever, I would write out five alternative paras that are included by default and the page randomly picks one each time it loads. Though, that may create complete confusion, and I have no idea where ProCache will feature in that situation.... Partly because of that I am going the halfway route - at least that will allow some overriding of text if needed.
  7. There is also a halfway house here, I suppose. Since I have to list all the products by name anyway at some point (make a list), I could use the batch page creator to create actual pages for them. These would use the default text that is held centrally, unless it is overridden by filling in the equivalent field on the new page. However, all the related service, which could be 10 or 15 per product and therefore the huge bulk of the pages, could be generated on the fly. Really, PW is very good for this sort of mass, localised, SEO - maybe that is something that should be written up (including some howtos). Very useful for any developer! Any serious SEO experts on here want to put together a list of tips that could go into a tutorial that I can then write up?
  8. This is all about a site that will have a lot of pages, or might have, depending how I do it. So: I have a parent page with a long list of manufacturers. Each links to a page for that manufacturer. The pages have identical copy, except the name of the manufacturer is changed within the text. Each manufacturer page has a long list of products. Each links to a page for that product. The product pages have identical copy, except the name of the product is changed throughout. At the bottom of each manufacturer and product page is a list of services that can be applied to each item. These link to the services page which is customised with the name of the manufacturer or product. One way or another, there could be a lot of pages - I am guessing at around 1000. Now, there are two ways to do this. The hard way is to create actual page records in the back end of ProcessWire, possibly with default text taken from some central page and then using hanna code to replace key words with either manufacturer name or product name. The other way is to do the pages on the fly using URL Segments to supply the name of the product or manufacturer. There are certain advantages from my point of view to both - the second is one hell of a lot quicker for me to create, while the first allows me to override default text if that is needed (though, it possibly never will be). This is really all about SEO in the end and is because lots of other companies in the same secteur are doing similar things and the client wants the same. So, the question is: Which is the better route? Are there performance issues? (The client will be on a shared server - they are only little) Are there management issues? (Though the client is not exactly tech savvy - he sees his entire world through his iphone, and not very efficiently) Are there SEO issues (not with the copy, but with things like site maps, crawlers and so on) I will probably use ProCache in the mix on this one. I am just planning this out to code up in the next couple of days, and if anyone has any sage advice, I would be very grateful... Joss
  9. I have found the spellchecker plugin I mentioned earlier works very well. You could also use CKEditor instead, if you wanted to.
  10. Are you sure the version of the plugin you are installing is compatible with this version of TinyMCE?
  11. Also... Did you try and put selector:'textarea', nanospell_server: "php", nanospell_dictionary: "en,de" Into Additional Settings?
  12. The TinyMCE Spell checker I have user I placed in: /site/tinymce/myplugins/spellchecker Then in the Third Party Plugins bit I put: spellchecker : /site/tinymce/myplugins/spellchecker And then in Buttons 1 I added spellchecker I think it was this one: http://www.tinymce.com/wiki.php/plugin:spellchecker Just as a thought, you may be able to do the additional setting in config.php within the nanospell plugin folder
  13. ooh, we got one of those?? Must remember that.
  14. If you set your image field to allow a maximum of 1 image, then you can treat it as a single value. However, if you have it set for more than one image, it is automatically an array, even if there is only 1 image in it. If it is an array, you then have to tell it which image in the array you actually want - for instance using first - just like any other array in PHP. However, normally you would allow more than 1 because you want to loop through them, for a gallery, for instance. If you only want 1 image, I suggest you edit the field and set the max number of images to 1, just to save confusion.
  15. I think it is in the list of modules in the admin
  16. Joss

    Lister

    Wong thread - delete this
  17. Obviously, the pages page on the admin also does exactly that, though for all pages. If you are using the dev version there is a lister module as part of the core (I think) https://processwire.com/talk/topic/5835-lister/?hl=lister This allows you to create lists of pages based on set criteria Remember, that if you are creating roles, the users will only be able to see pages in the admin what you want them to see. When you create templates, you can also restrict who their parent is and what templates can be used for children, or even if they can have children at all - see the Family tab on a template. You can also create an "Add New" button on the Pages page. If you look at the family tab on a template, you will see instructions for adding that template to the Add New button - the button will automatically appear if one or more templates are set up in the right way.
  18. Er - isn't it normal in html to have the <img> tag to display an image?? <?php echo "<img src='{$article->featured_image->url}' atl='{$article->featured_image->description}' >"; ?>
  19. Christian As a starting point, create a folder in /site/modules/ called something like MyAdminTheme Then copy all the files from /wire/modules/AdminTheme/AdminThemeDefault/ into your new folder Change the name of the file AdminThemeDefault.module to MyAdminTheme.module Edit the file so that the class now says: class MyAdminTheme extends AdminTheme implements Module, ConfigurableModule { public static function getModuleInfo() { return array( 'title' => 'Default Admin Theme', 'version' => 1, 'summary' => 'Minimal admin theme that supports all ProcessWire features.', 'autoload' => 'template=admin' ); } So, the name of the folder, the file name and the class name all match. You can change the title, version and summary to what you want. Now go to your sites admin and modules and install this new module. That is your starting point - you can now edit it to your heart's content. I THINK that is how I did it last time! Someone else might pick up anything I have missed!
  20. Joss

    go hard with wp

    I agree - it is really worth the time making sure that everything that is available via the ProcessWire website is, as much as is practicable, checked to be safe to use, but not trying to affect anything outside of that system. However, this also needs to be made clear - especially for downloads on the forum; those should always be flagged up as Not Approved. One thing that does help here is that since PW in its native form is NOT like Drumalpress, as in it does need work to get it going for a website, doesn't have themes, and so on, it is not really ripe for a million and one plugins that introduce possibly insecure third party scripting. The most famous example of that over the years has been the old perl mail script (a php version was also made) that was adopted as an installable script by just about every hosting company and was also used as the core of many plugins for countless early CMSs. Until, that is, it was found to have a basic, really bad security hole that affected everyone. I think as part of this it is worth limiting the number of modules available and making sure dated ones are flagged up or removed (like my old Bootstrap profile - this makes it more manageable. Nico's idea of certification might be worth looking at eventually, but that can put Ryan in an awkward legal position if something goes wrong; if he is certifying modules, he then legally becomes responsible for them....
  21. In the TinyMCE settings that are on the input tab of the field, you have to allow tags to be used and also things like the style attribute. I cant remember what is in the default installation, but it is fairly basic - it is easier to add things than have to strip out loads of things that you would rather your users did not get their hands on! For instance, this is the settings I use when I want to have a few more bits like right click context menu and stripping formatting when pasting. Also adds a style drop down:
  22. Part of the problem with using something like Code tags in this way is that you have to switch to HTML to do it - I always think that that undermines the idea of using a WYSIWYG editor in the first place, really. Have a look at this link: http://stackoverflow.com/questions/7153599/add-code-button-to-wordpress-tinymce It is a bit old, but it might offer a better way around your problem. There is also a link to a plugin that does it for you. Haven't tried it, though. You should also make sure that you are using a custom stylesheet for TinyMCE so that it displays code in the same way as on the front end of your site, of course. This also looks quite fun: http://lab.nomadonweb.com/en/sh4tinymce It uses SyntaxHighlighter 3 by Alex Gorbachev
×
×
  • Create New...