Jump to content

Joss

PW-Moderators
  • Posts

    2,862
  • Joined

  • Last visited

  • Days Won

    47

Everything posted by Joss

  1. I have just done one quick test with the new FieldtypeCropImage.module file - and it went fine. Create field - chose cropimage and add title - save. Went to input - removed existing thumbnail setting, added two new ones and selected Display Thumbnail. Save Added to template. Opened existing page, added image. OK Went back to field, added another thumbnail setting, Save Reloaded page edit - OK Went back to field, changed max images to 1 and set image upload sizes - save. Reloaded page edit - OK Closed pages and reopened - still OK. So, with any luck that has solved the issue!
  2. Repeater would be the obvious option. Though, depending on what you were doing, you could do this in two bits by using a page field to drag in another page with extra stuff. I do this when I want to specify which side blocks (as an example) I want added to a page from a central "library" of blocks. Now, that does not bring extra fields into the page editor itself, but it is a way of bringing in extra data, even though you will have to edit it separately. I suppose you could also have a bit of delimiter fun - using a textarea to add info with a delimiter or some sort of marker so that you can sort it out in the template. But the problem with that method is that it breaks the PW philosophy of having everything stored individually and correctly in the database - as Ryan has pointed out before, you end up creating a flat-file within a relational database. Still, possible to do
  3. HI APeisa I haven't done any upgrades, so this has only been with a new install. This particular time it is a very clean one as I have been writing a tutorial. It does seem very inconsistent - On my current intall (2.2.17) it wont work unless I have "thumbnail" as the first thumbnail - the dimensions dont matter. However, on another one which is 2.2.14 it is working fine without having "thumbnail" in the list at all - though I think that was the install that I managed the workaround I came up with before. So, to be honest I am completely confused. I was trying to come up with a definitive set of circumstances where it did work or didn't work, but I have not managed that properly. Sorry. I don't know if there is a browser caching issue going on that is confusing things. It does seem to revolve round the default thumbnail in your script, which is what Soma pointed out before (I think it is on page 8 of this discussion). It is almost as if it is expecting to see something in particular and if it doesn't it chucks out an error or fails to upload the image at all - it cant find the thumbnail, therefore the image does not exist. But I am guessing wildly!
  4. Hi Apeisa I am still getting trouble with this module on the Dev version. Exactly the same as before, except my work around is not working. So, create a field, save it. Then save it again. Check it with a new page and it works. Change the thumbnail values and save it. It now does not work. Not only that, I cannot open a page to edit because it just throws an error saying it cant find the first thumbnail on the list and does not open the rest of the page for editing. This seems really inconsistent. On another installation where I got it working it is still working, but on this brand new installation I cannot get it to work at all except with the default thumbnail value. It seems to work as long as I have the first "thumbnail" in the list. If I take that out it fails. But I am going in circles trying to clarify that Joss
  5. Thanks! Well, I like a challenge and it was a bit of fun. And I get to do jazz so rarely!
  6. Currently, most people develop so that paths don't change (root on their local server solution and then root on the final site) If you are developing in a sub-domain, it is a couple of minutes work to do a search and replace in the database to change the path. But, and this is a big but, I think if most of us were designing a site like desk.com, we would not be relying on a wysiwyg editor, but using simple fields (text, textarea, image) and leaving the construction to the template files and assoiciated CSS in style sheets. When you look at the source of Desk.com. that is how they have done it. Desk.com is controlled by a 17,000 line style sheet (looks like it started as Bootstrap somewhere in the past) with huge amounts of overrides to deal with every version of IE, sort out all the responsive side and so on. That includes all of the background images. And it looks like they are loading most of the JS on every page. It may be to your advantage to change the way you were thinking of designing this and keep the database for what it is good at (storing the site data and relationships) and work on some really storming template files that give you exactly what you want. I think you may well end up with a much better site that is much easier to maintain for the long term.
  7. To add an image to TinyMCE, make sure the template has an images field - that will be your local library for the page, if you like. Upload what ever images you want. To insert into TinyMCE, click on the TinyMCE images button - a bespoke images popup will open listing all the images from your image field (Note: you can also browse images from other pages). Select an image and resize to suit (an automatic thumbnail will be created). Choose your alignment, and click the box if you want the image to link to the original version. Insert, and there you go. NOTE: If you would like those images to open in a lightbox (for instance colorbox or fancybox), Install and set up the jquery plugin (making sure you also installed JQuery, of course) and then you can use a bit of jquery to automatically add the required images for any <img> tag that is surrounded by an <a> tag. Probably limit it to the container where your articles appear, for safety. The image system in PW means that when ever you dictate sizes, whether that is via TinyMCE (and CKEditor in a day or so), or set sizes when rendering images in your template files, thumbnails are cached of the right size without you actually having to tell it to do so. And if you are using image fields (rather than inserting via TinyMCE), there is also a superb Thumbnails module that allows you to preset multiple thumbnail sizes and comes with a Crop function so you can customize each one.
  8. Yes, looking forward to trying this. It should look nice on my Bootwire admin!
  9. Yes, I think the resident "Crazy Genius" is right. It would not take long to put a framework of blocks that did what that site. The hardest part is working out what you are going to put into the boxes, to be honest.
  10. Just had a look at Desk.com and it would be no problem to put that together with ProcessWire at all. With ProcessWire you can work anyway you want. Whether that is with repetitive content, like a blog, or a block based site like Desk.com Even there you have repetitive content - if you look at the Customer testimonials page, they have one template for the short testimonials which is reused throughout the page, and another for the featured testimonials. And they have a blog too, of course. With Processwire you can create very individual pages or you can produce very similar pages - PW does not work one way or the other, it is completely up to you. You can create as many templates as you like, or as few, and you can use TinyMCE as much as you like and configure it differently for every single field, if you wish. You can include templates within templates and pages within pages, allowing you to create a block based system where you create a library of blocks and call them with a select field into another page. If you talk to the designers that use PW you will find a huge range of sites from ones with thousands of pages to ones that are simple brochures with a completely different layout on every page and an dizzying array of effects. The point is that ProcessWire is a CMS Framework, so it does not have a fixed way of working - that is down to you.
  11. hmmm - maybe you should add an export function to the Pro Cache module ...
  12. Yeah, I need to write it up differently and relate it directly to the first tutorial - makes sense if one can neatly build on the other! Meanwhile, useful little snippets
  13. This is seriously useful! I was thinking about using WYSIHTML Bootstrap thingy on front end forms - this should be a perfect addition!
  14. Digitex I am with you there. However, as soon as I find a really good solution, I am trying to store it as a reusable something, even if it only a reference. If I am feeling sensible, I even remember to comment it so I know what it is. I do this with music too. I am a professional composer, but if I come up with a really nice brass arrangement, I often store it separately - I wont use it again exactly as it is, but it is really helpful if I am looking for a particular sound.
  15. On some of mine I include all kinds of variables - but I have a habit of creating libraries of them as includes or css files and then using page fields or other ways of just sticking them all over the place. But I think with including a <script> one of the easiest ways is to just use a term so you can say IF this then include THAT. THAT can be anything from just a script reference, to a whole ton of code - doesn't matter really. It could even just be a trigger to include another file which has lots of bits in it. You can put that code in your footer and if it does not exist, then it just gets ignored. Very simple that way. I know you have to update your footer, but then, you would have had to FTP the script up in the first place. Having said all that, with things like galleries/carousels and so on, I tend to have a dedicated template file because the layout is very different. So this is not an issue. As Sinnut says, allowing php code to be executed through a field does sound a bit horrible!
  16. Generally, putting code via fields is not a great idea. Without creating lots of different template files for lots of pages, you can get clever. So, for instance you can use a bit of php on the template file to include some extra script on a certain page only. <?php if($page->name = gallery){ echo "<script ........ >"; } ?> You can also use a text field or text area to list some names of scripts, eg: gallery fancybox tabs Each with just a space between them Then, grab the field in your template file and turn it into an array using the space between each word to split up the words: $myScriptArray = $page->myscriptfield; $myScripts = explode(" ", $myScriptArray); Now you can loop through them and do different things with them: foreach($myScripts as $myScript) { if($myScript == gallery) echo "<script gallery.....>"; if($myScript == tabs) echo "<script tabs.....>"; } And so on. WARNING! I am not a php expert (or even much of a beginner) so I may have made mistakes above, or someone might have a neater solution
  17. I am not sure if this will help. If you look at the title field in Setup > Fields, you will see that the HTML Entity Encoder is added on the details tab. Hmm ... not going to help the page "name", though
  18. Something I regularly add is this to Additional Settings: paste_text_sticky: true paste_text_sticky_default:true This automatically removes formatting from anything pasted into the editor - this can save a lot of mess! And if you want to turn the context menu on, add contextmenu to the plugins field.
  19. You can customise TinyMCE exactly the way you would normally, just using the field configuration. Go to the field (body, for instance) go to the Input tab and click on TinyMCE advanced configuration In the valid elements add -sub,-sup, to the end of the list (probably after pre so it ends code,pre,-sub,-sup,) In the theme_advanced_buttons_1 field, add ,sub,sup somewhere. And that should do it. Check on the TinyMCE wiki for other stuff you can add.
  20. Try using a more defined selector. $news = $pages->find("template=news-item, limit=5, sort=-date, parent=/newsparentpage/"); You might not even need the parent if the template is enough.
  21. http://www.bbc.co.uk/news/technology-21697704 Looks like you are much safer sticking to using a nice little Cray then.
  22. Oh I got a couple of things up there already. (and I used to have a ton of things on Source Forge about 12 years ago - and on Fresh Meat) Though this one was a hassell. The first version Uploaded fine, then I went to update it and it complained about a Detached Head and then a bunch of other errors .... So, tried again. But I did add categories in the gap between the two!
  23. I look at it like a line of obedient hounds following a trail of tasty morsels. When they get to where you are currently standing, they all sit there looking at you with big, expectant, eyes, waiting for you to drop something.
×
×
  • Create New...