-
Posts
2,862 -
Joined
-
Last visited
-
Days Won
47
Everything posted by Joss
-
For a little bit of fun, I have written an alternative (and possibly inaccurate) overview of ProcessWire. https://sites.google.com/a/stonywebsites.co.uk/cms-notes/ It is on the front page. Joss Well, I like to give the customer his money's worth http://www.foodloversdiary.com (the salmon recipe would have gone up, but it got eaten before I could grab my camera!)
-
Wow. you know where I am going? That is one up on me - I never know! These are just the sort of rough notes I keep for myself on everything - I have a memory like a swamp (but less attractive - too many years in the music business) If you can set up a category that is called pages for checking or being worked on or something so some poor unsuspecting innocent does not wander in and think this is Gospel, I would be happy to start putting in all kinds of stuff. Actually, that is a good idea whoever is inputting stuff on a Wiki - the good side of a wiki is that it encourages community co-operation. The not so good side is that there is often a lack of editorial process, and readers can get really messed up! Getting some sort of oversight also frees up and encourages contributors - they are less worried writing something that might be wrong or has already been covered, or needs to be cleaned up if they think someone else is going to check the entry before they put their foot in it. I would suggest a series of banners: "This article has been adopted as part of the official documentation" "This article is awaiting peer review and is not yet adopted as part of the official Documentation" "This article is currently work in progress and should not be used as an authoritative source." The last one would be automatically added to all new entries. Oh, and all articles should be related to PW versions, so stuff that applies to v2.2 but not to 2.3 is clearly marked as such, for instance. If anyone has ever used the Joomla documentation via google, they will know that they can spend hours trying to make something work that wont because they ended up on the old help site by mistake. (Oh, was that only me then?) Other bits and pieces that jump to mind is with relating the WIki to a snippet library (possibly) and making sure things like the SyntaxHighlight GeSHi extension is installed (probably is). I could waffle on all day about this stuff - mostly because I am no fan of MediaWiki! (but use it anyway.) Anyone got a great big Java servlet based server so we can install Liferay??? Joss Edit: On a side note, I have just cooked baked salmon and served it with a turnip and carrot purée with orange zest, a mushroom and fennel sauce and pepper and pea cous-cous. Just thought I would throw that in.
-
What's the most elegant way to replace a copy image?
Joss replied to alan's topic in General Support
Hi Ryan I like the option of being able to decide to replace an existing image (when uploading) or rename. You could also make that a switch in the image field settings - overwrite automatically or ask for confirmation. I generally find the caching issue is okay as long as you do it in the morning, go out for a really long lunch and play a round of golf or something. When you come back it is fine! Of course, the incredibly complicated (and ultimate) way of doing this is with short codes. In this case, the image would be saved with a database reference that includes things like size. The shortcode in TinyMCE would be interpreted appropriately on the fly (you would need a custom plugin for TinyMCE I would guess). You would then be able to change the actual image that the database refers to without changing the entry in the TinyMCE field since it is pulling the information live. The bad side of this is that it is incredibly complicated and makes a mess of everything. The up side is that you can store a large amount of content with the image (including any metadata), keep track of usage, originating source, licensing, user who uploaded it and the rest. Okay, probably only useful on a big news site .... stick to just overwriting the file. Joss -
Haven't tried face, but both size and colour work, as it does in normal css Really, it would be nice if it added it to, for instance, the <p> tag, but I can't get it to do that. Checking one of my Joomla installations, it does the same thing: <p><span style="color: #000000; font-size: 20px;>my words</span></p> Shows how little I actually check the source of wysiwyg editors!!! Be interesting to see what other editors do in this case - especially the jquery/html5 editors which is where I think we should be headed for basic editing. Joss
-
Well, just for fun, these are my rough notes (I have hidden all the ones that say things like "what the bloody hell is this?" or are my notes directly about one of my projects https://sites.google.com/a/stonywebsites.co.uk/cms-notes/
-
Wow, that cat got well and truly skinned! Joss
-
Philosophically speaking I like to think of Categories and Tags as two directions on a matrix; Categories are hierarchical and are therefore vertical, where as tags are non-hierarchical and therefore horizontal. Of course this goes a bit squiffy if any one item can have more than one category! Then it belongs to two or more vertical relationships in the family tree, though it could be horizontally related by only one tag. (I think I need a sit down.) I suppose that in PW you could actually look at it three ways. Your page layout is a strict tree where any one family member can only be in one part of the tree at a time. You can create limited categories (using a select system) which have very strict usages. These would be close to the page family tree, but not limited to it (especially further down the tree) and any item can belong to more than one category. And then you can create tags which are free and can go across all pages - these can be selected and/or created on a page by page basis. Your menu can either be restricted by how the menu is output from the Pages part of PW, or you can add custom bits of menu straight into the template. So, you can list things that are linked together by set categories or even by groups of categories (my programming abilities fall over on this, but many here can help). That way, in theory, not only can you display all services to do with Water, but you could also all jointing services to do with all main headings. Basically, what I think I am saying is that you don't have to be limited by how the built in page<->menu system works together. Joss
-
Dave, your faith in mankind is enlightening! Years ago I helped write a technical manual for a system I did not understand at all. Those that really did know, however, could not even grasp enough good grammar to successfully request a cup of coffee without help. Here is what we did. Once I worked out what the final user would want, (which was a lot more comprehensive than was originally envisaged) I wrote a whole pile of pages that consisted of little more than. Actually, It was a little more detailed - I often wrote the introduction, for instance. The tech boys filled in the gaps and I then went over it and rewrote it to make it as near a pleasure to read as possible. What I had identified was that they knew what they were talking about, but knew surprising little about the audience or how much the audience knew already. This was pre-internet and was a printed manual and so had to carry all its own references, which was cumbersome, but it worked. In fact, by the end of it, the techs' writing abilities had grown substantially, though they still forgot to mention things if no one chased them. The worry with the PW wiki is that I could probably start a huge number of "stubs" that would need sorting out by people who a) know what they are talking about and b) may not have time to sort them out in a timely fashion, leaving the wiki looking a mess. Joss
-
Hi Dave This reminds me a bit of playing Zork (or programming with Inform7, perhaps). I like the fact that in zork you can say "open box" and it will come back with "there is no box here." Or "open cat" and it replies, "you cannot do that to a cat." But in either case, the actual program is still running - you get to have another go or you can go somewhere else. I warm to the idea that even without instructing a programme with ifs and maybes, if what you ask does not make sense it produces what it can and then prints out a neat little message saying "I tried, I really did, but I could not do that thing you wanted on line 6. Here is everything else though " Mind you, I would be a little upset if I got it really wrong and all I got was a white page displaying strong, very final text: "Your site has been eaten by a Grue."
-
Since my real job is as a composer, this jumped out at me. Very nice and clean; perfectly suited to the performer and the intended audience. I like the look of PrettyPhoto too, so I will look at that later. Nice one! Joss
-
I am making my own collection in a google site, though I would be nervous of putting them in the wiki as I think the accuracy of some of my notes are suspect to say the least! I am not bad at explaining things, however (Which is a touch of a relief since I am meant to be a professional writer!) One thing that would be very useful is some very, very short howtos with examples. I have found what I search for most is things like "how to get the output from a page field" or "what path do I write to include something;" really simple stuff that tends to get left out because the more experienced writer forgets that not everyone is starting with their knowledge. It is the curse of "assumed knowledge" that haunts every technical manual. "What do you mean, you can't read my mind?" This has been a problem with just about every open source system I have ever attempted to use - the documentation is brilliant, as long as you already know how to use the software .... So, covering the basics, complete with one or two simple examples that can be copied and pasted, would be extremely helpful. To a certain extent, I suppose, it is probably going through many of the variables in the API and expanding them to show how they are used. I sometimes wonder whether the eventual Book that everyone rushes out to buy, ought to be actually the edited result of the community created documentation. Not sure if that has been done or not. Joss
-
Well deserved! Ryan, have you got a decent quality version of the Processwire logo? That, or some neat little banners might be nice for people to put on their design sites and portfolios. Something like "I Use ProcessWire" might be fun too. All helps to spread the word. Joss
-
Hi Martjjn I haven't played "Retina" on websites yet. But I have had the impression that really you need two images - one with the original pixel number and the alternative with double the pixels so that you are covering both retina and normal displays. There is this JQuery plugin, I notice: http://www.tylercraft.com/projects/jquery-retina-plugin/ So, I suppose you would need to be uploading the Retina image and then the image (and crop-image) plugins automatically create a lower res version with a suffix. This wouldn't be a tinymce issue at all in that case. Joss
-
With CSS 3: tr:nth-child(odd) { background-color:#ccc; } tr:nth-child(even) { background-color:#666; } Or, there is this JQuery to add classes (I haven't tried this, just stole it....) <script type="text/javascript"> $(document).ready(function() { $(".myTable tr:even").addClass("bgOne"); $(".content div:odd").addClass("bgTwo"); }); </script> Joss
-
And a few I probably never want to hear of again!
-
Very clever Ryan! I had tried just about everything else, including adding them to P - span I had not thought of, however. Mostly because reading the TinyMCE docs and their default valid_elements they have them associated with font and not span. Another one for your wiki at some point. Thanks loads Joss
-
HI I posted this on the end of another thread, but it is a bit far down on the list. I need to enable font colour and font size on a field. I have added to the tool bar, and that bit works. I have added this to the valid elements -font[face|size|color] I have added @[id|class|style] However, when I use the buttons it changes the size,but it is not saving the change. And if you open the html on TinyMCE, it hasn't been added as a style to the element. I have tried with and without the - in front of font, I have tried sticking "style" everywhere I can think of, I have tried changing the order - where I put the font group. But nothing is working. Any thoughts? Joss Solution This has been solved by Ryan on another thread. Rather than use font[face|size|color], please use span[face|size|color] J
-
You can put templates within templates. So, if the central bit of data is the same each time, but the content that goes around it needs to be different, you can include one inside another. For instance, you can create a file called layout1.inc that has one version of the layout. Then include that in your template in the right position. You can create several different layouts and decide which ones you want using options on your template. You can make the entire template up with 4 or 5 includes, all supplying different parts of the layout For instance, I have a general page that looks like this: <?php $maincontent = "TB_mainbody.inc"; $secondcontainer = "TB_sidebar.inc"; /* * Construction */ include("./includes/TB_head.inc"); include("./includes/main_layout.inc"); include("./includes/TB_foot.inc"); ?> The two variables at the top relate to includes that are in main_layout,.inc, in this case. So, this template calls three includes, and one of those (which has some very simple markup) calls two more that has all the main fields for the template. I can change the variables and I end up with something completely different. It is probably a case of drawing it on a piece of paper, Joss Edit: By the way, the reason I split the above into three files rather than have one full of variables, is that I like to be able to change the header and the footer of my template independently sometimes. It is not any better, but can make it a bit more reusable.
-
Thanks Soma! That is some nice useful extra info
-
You can also get even more clever, if you want to have some fun. For instance, if you only want to have one layout, but change the color of all the H3 elements, you could create a select that gave alternatives like "blue headings," "red headings," "grey headings." Or, more dramatic, you could ask if they wanted the side bar on the left or the right. Then in your template php file, include the alternatives depending on what the select is - you can change classes, create layout alternative and so on, all on the same page and just call them with lots of if statements. That then gives your clients some fine tuning while understanding what the result would be. You can also do this by having lots of template alternatives - but if you are offering 4 or 5 things that they can alter, the permutations could get rather mind boggling! Joss
-
Hi Diogo I did it your way on something earlier, but then I realised that a client might want labels on the select that said something more complicated, or even had punctuation in it. For instance: "Yes, I want it now" and "No, don't send me anything!" So, this way it allows a difference between the label and the value. But you are right - on my example above it probably isn't necessary. It is me just covering my butt for the person who says that their value "My $%!*ing cat's got an @ in his email address {isn;t that nice}?" broke their template! By the way, the "null" issue is a bit of a nuisance - it would be nice to be able to add either a no-value option "Select one" or default onto one of the page options. At the moment the field is just a blank, which is a bit sad looking Joss
-
(can someone check this for accuracy and let me know any changes I should make - I am very new to PW) I wanted to create a simple select drop-down, but there isn't one in Processwire by default. Reading the forums, it became clear this was for very good reasons and that you are expected to use pages. But I couldn't find clear instructions how to do this. So, having worked out how, I wrote myself this little tutorial: ##################### Processwire by default does not have a simple select field. The reason, given by Ryan the developer, is that a plain simple select field is not related to the database, so you have, in effect, some of your data in a flat file - sort of - which is not good practice. The preferred way of doing select fields is by using pages for the values and the Pages field to list them in your form. If you just want a simple on/off state, use a checkbox, but if you need more options, then this is the way. Creating Pages for Select Fields These pages must be published to be accessible by the pages field but are obviously not wanted on the website. First, create a dummy template (a tempalte with no associated file) called something like "selects." Give it two fields - the normal title field and a text field called select_value Create a Top Level (child of Home) page called Selects (or something friendly). Give it a blank dummy template. Make this page hidden. Create a child page and call it something that will work for this group of selects - perhaps call it "Yes No." Again, give it a blank dummy template Create three children under this - one called Yes, another called Maybe and a third called No. Use the dummy template "selects" that you created earlier. In the select_value field put a value - in this case the most obvious would be yes, maybe and no! For ease of use, make sure these values have no spaces or anything clever. These three pages will be your select values. How to add to a template Create a field using the Pages field type. Call it something like "yes_no_maybe_selector" Under the details tab, select the single/null option. Under the Input tab, select the Yes No page as the parent. This will then display your three children in the select. Choose either Radio or Select. Add this new field to your template in the usual way. How to output into your template.php The field is called in the usual way, remembering to call the particular value from the select page. So: $page->yes_no_maybe_selector->select_value; The chances are that you are going to use this as a condition - if "yes" do something, if maybe do something else and if "no" do something else again. IMPORTANT: You cannot set a default state - so you will always have another option - Null. So, if you are only wanting to do a two way selection, then you are probably better off just doing a simple checkbox. In this example, therefore, we will effecting have Yes, Maybe, No and Null - that is no, twice! Never mind.... First, lets add it to a variable: $yesno = $page->yes_no_maybe_selector->select_value; Now, we can set up our variations. if ($yesno === "yes") { echo "Say Yes"; } elseif ($yesno === "maybe") { echo "Shrug your shoulders"; } elseif ($yesno === "no") { echo "not a chance"; } else { echo "nada"; } Note that the last option is effectively the null option, so something is being outputted, even if it just some blank space which saves potential errors or silly bits of markup (well, in my case that seems to happen!) And that is it! Joss
-
Words of encouragement from the Pub's amateur psychiatrist (Read best in a soft spoken, German accent) Ah, you are here because you have been reading things in this forum about pages that have left you confused, disorientated, befuddled. You thought you knew what a page was - you have been thumbing through them, folding them, studying them, wrapping things up in them and scrolling up and down them for most of your life! A page is this solid item - this great lump of data stuffed with things. But now you have come to Processwire, and everything you thought was true, simply isn't any more. For in Processwire pages are completely different - they are not great gulps of information, but tiny little things, nothing more than a link to the more interesting world of fields and templates; just a little blip of data in your huge fascinating database. Pages in Processwire are used for all kinds of things. They can be used as a marker in your pages list. They can be used as a group parent for other pages. They can be used as categories, tags or lists or users. And they can even be used for simple drop-down selects - just to supply a label and value. It can seem crazy to use such an iconic thing like a page for such a mundane and trivial task! But don't worry and fret, don't lose sleep or pace the floor as you think the reputation of the noble page is being crushed! In Processwire, they are fulfilling their duty to the full - and the more slight the task, the more they bound up to the wall and jump up and down shouting "use me, use me!" And, as a bonus, they can even be used for content - for all that stuff you thought was a page, but in Processwire isn't! So, don't be put off by the Processwire page - use it for everything! it is much smaller than you think, takes up hardly any space at all, is well behaved and only will do its thing when it is called. In fact it is hardly a page at all .... and then again, it is also so much more!! Better now? Joss Freud
- 6 replies
-
- 26
-
-
Since everyone (mostly) are nattering on about responsive templates of one sort or another, though you all might be interested in this little article that I found giving a rough sum up of a pile of responsive frameworks. Not all, by any means, but not a bad little collection: http://designshack.net/articles/css/which-is-right-for-me-22-responsive-css-frameworks-and-boilerplates-explained/ Joss
-
Sorry to drag up an old topic. In a TinyMCE field I had added this to valid elements: ,font[size|color|style] And the buttons to the tool bar: forecolor,fontselctsize The buttons work, but it is not saving. Anything I am missing? Joss