-
Posts
2,862 -
Joined
-
Last visited
-
Days Won
47
Everything posted by Joss
-
Best way to create user editable complex lists?
Joss replied to photoman355's topic in General Support
The nice thing about doing it through the template is that you can allow any number of repeats(?) in the repeater field, but tell your clients it will only use the top three, perhaps. Since they can re-order by dragging and dropping, they can just move the ones they want to display to the top of the list. In some circumstances that is quite a powerful way of managing the data. -
Best way to create user editable complex lists?
Joss replied to photoman355's topic in General Support
Unless I have missed something , you could start with a repeater field. For instance it could have two fields - Field A and Field B (or however many fields make up each line of information). You can then loop through the fields with a foreach foreach($page->myrepeaterfield as $listitem){ echo "<li>{$listitem->field_A}</li>"; } That would get you one long list. However, if you wanted to get it into two columns, you could count how many items there are in the repeater field and divide that by two to get a number (making sure there are no decimals). You could then get the first X number of records and loop through them in one UL, and then get the rest of the records and loop through them to do the second UL. I am not totally sure how to do that, but I doubt it is very complicated. -
Outputting javascript or css from a field is bad practise ?
Joss replied to pwired's topic in Getting Started
I am not sure of the good or bad, but generally I find the idea of passing any code via a field makes me uncomfortable. However, you can do other things. For instance, if you have various styles in a CSS file, you can add those styles via a field that just adds the class name to the element. Or, you can include entire style sheets and JS scripts using a field for the page: <script src="<?php echo $page->myscriptfield; ?>" ...... The nice thing about working that way is that you can create a series of style sheets and JS scripts and then the client can choose them using a page field as a select. You then don't have the worry of someone entering something in the field that breaks the entire page, and you can fine tune your "themes" without having to edit pages. If they go together in pairs, you can create a template for your page field selects that has three fields: title - nice description js - text field with the name of the script css - text field with the name of the style sheet Using a page field, you select using the nice description, then use the other two fields to call up the JS and CSS. Lots of variations possible without entering any code into a field. -
I could live with that .... or not...
-
Yep, that is the extension
-
Done, ta!
-
Oh, I give up trying to keep the world of browsers pointing in the same direction!
-
I dont seem to have trouble copying from Chrome to Textpad
-
This is something Pete and I have been scratching our heads over. Though I have been looking at it the other way around - basically, a simple PHP starter, using ProcessWire as the back end to give you something to work with. Hopefully, the result would both teach someone how to do quite a lot of useful PHP and get them firmly welded to ProcessWire at the same time ....
-
Ah, thanks That was because I originally had fields for both keywords and description, but decided to drop keywords since they are not often used now. Oh, and welcome to PW! Hope you get to like it as much as I have. You will see Matthew Scheneker on here too, who used Seblod and Joomla more than I did, so if you have any questions relating one to the other, ask away. Mind you, everyone else will probably join in anyway (they do that a lot round here) Joss
-
Make it both Kidneys - oh, and your dog's kidney too. The one I really want to do is going to take the longest (for a variety of reasons), but I think I will do one about creating and managing blocks of information in traditional CMS style. Can't do it immediately, however, as I have some orchestral stuff to arrange first, which always messes my spare time up.
-
HI Mark I tend to stay away from Videos myself, basically because I believe people should absorb information at their own pace - well, that and have you tried copying and pasting from a video?? I will come up with more tutorials; I have a couple planned..... Joss (PS: if you want to pay me to make videos, I am happy to oblige! Been in media production for 35 years .... I am not cheap, however )
-
Yes, I have used Joomla for years and am abandoning it. My first sites were made with the Geocities site builder (1998 ish?), then hand coding, and eventually Dreamweaver. What disappointed me most about moving to things like Joomla and Wordpress was the loss of the design control I had with Dreamweaver, but I wanted the overall site management I got with the CMS. The joy of ProcessWire for me is that I can move back to to that Dreamweaver/raw coding design control (which is so much faster) while still retaining the power of a CMS. I dont have to design while worrying whether I can actually make this work in Joomla. Once you think of it in that direction, once you realise that PW is not restricting your basic layouts, then it all becomes much, much easier!
-
No reason why not. Pages automatically have two values "created" and "modified" which are unix time stamps. So, when you do your "find" statement you could add that to the mix. Probably run it in the same way I have done the categories - create a list of years or months, pass them via the URL as a get, then retrieve them using "input" as I have done with the category. Then use that as a selector somehow. Need to check with Ryan or someone as to what parameters you could use to get the year bit from the unix time stamp. Alternatively, you could add an extra field that was a year into each of the news article pages, and use that as one of your selectors. Like with most things with ProcessWire, there is probably a lot of ways you can do this!
-
HI Stephan - I have a really bad cold and I am not totally sure what you are asking. You can put anything anywhere you want really without it having to be a module. In fact, a module would probably make this too limited. The only reason I put these into functions was to demonstrate how simple the template files can be. But you could write these as includes, you could write them directly into the template files themselves and so on. You can follow any kind of file structure you want within the template directory. Basically, you can separate logic and display out completely if you want, or work more inline. I tend to mix it up because I never seem to do things the same way twice!
-
ummmm My school didn't have a website .....
-
Field naming, namespacing, and how we can prevent excess of fields
Joss replied to Rob's topic in API & Templates
I must admit, I am rather confused by what you want to achieve. In processWire, each field (not field type) has its own table. So, if you, for instance, create several different templates for different types of news articles, but each has a common "Main Text" requirement, then you might wish to create just one main_text field and use it throughout those templates. You will end up with one table in the database with all the "main_text" from the various pages and templates. However, within one template, how would you have multiple identical fields all storing to the same place? Surely you want the various fields for the various bits of information stored separately? So, 5 textareas - intro_text, main_text, sidebar_text, footer_text, summary_text - or whatever you want. Each will be stored in their own table, but they will all be textareas. With repeater fields, they are actually separate pages (you can find them under the Admin page) that are called into another page. As for the "only one way to do things" comment, you can do things lots of different ways, however, it has to work within the design of the database! Joss -
Field naming, namespacing, and how we can prevent excess of fields
Joss replied to Rob's topic in API & Templates
On the latest version, when sorting out your field list, use the tags under the advanced tab - very useful! On the actual template, you have two related field types - tabs and field sets. This allows you to make you form multi tabbed if you wish and/or to create nested sets. Since you will often use several tabs, I often create 4 sets (the end of the tab or field set is created automatically when you create the first) and have them sitting in my fields list ready to use. Like other fields, you can rename them in context of the particular template. Also, you can change the width of the fields on a per-template basis, so you could have 3 in a row (33% each) if that helps keep things related together. One way or another, you probably have enough variations there to keep things pretty neat! Joss -
I think a lot of the users who would use WordPress (especially) but even Joomla and Drupal would probably not be that interested in ProcessWire (and I have no idea how Ryan would cope if half a million users suddenly knocked at the door!) If a lack of instant solutions for every scenario is a weakness for some potential users, then that is a strength for others; those who might not actually want to get their hands dirty, but realise that that is the only way they are going to get the precise functionality they are looking for. For those, ProcessWire is possibly easier than others! On the docs side, various little efforts are happening in various places and will slowly come together. I have 3 tutorials now to get people started, starting with the Basic Website Tutrorial and of course the API section has all the nitty gritty bits, including the invaluable cheat sheet! More will come along!
-
On the sort, in the find() statement you can add a sort=created or sort=-created depending on which direction you want to head. Have you got page numbers turned on for the news index template?
-
Anyway, not really the place for a ModX discussion! (Particularly as I have never used it and am far too busy learning ProcessWire...) And I am sure ModX will do very well - they have a pretty good reputation from the little I know and I imagine they will support their users to the full. So, back to the original topic... Sparrow, I think you will enjoy PW very much. I don't have a dev background (or even much of a designer background), but I have learned a huge amount just by playing with PW - it is proving a surprisingly good way of learning PHP. Not that you need to learn a huge amount, but it gets quite addictive after a while.... You have made me think that a tutorial on creating a membership system would be a really good idea. But since I haven't the foggiest how to do it, bear with me while I get a couple of the guys here to teach me, and then I will write it up! Oh, and others have said, scalability is not an issue with PW - even on small sites it seems to take far less server resources than some equivalents, so that gives a good indication that it will pack the punch you desire. Your biggest issue in that regard is probably finding the right host, to be honest. Good luck! Joss
-
On a slight aside... I am wondering whether TinyMCE should become a /site/ module rather than a wire module - basically so it can be uninstalled, or not installed in the first place. If someone decides to use CK instead (or any other future RTF system), it seems daft to have tinyMCE still sitting in there. (Or has this been already discussed and I missed it .... again.)
-
Try these permissions: Files: 644 Folders: 755
-
So, why are my shoulders still aching?
-
I think your news functions file is missing the <?php tags