-
Posts
7,479 -
Joined
-
Last visited
-
Days Won
146
Everything posted by kongondo
-
Search filters and options for the Page FieldType
kongondo replied to landitus's topic in Wishlist & Roadmap
Not exactly what you are suggesting but I assume you are aware that you can already search using PageAutocomplete? Just a thought.. -
Nghi, welcome to PW and the forums Maybe use the "custom selector" right below the template selection field instead? I am assuming you are aware that template setting is optional
-
How do make a selectbox fieldtype with static values?
kongondo replied to alkahest's topic in General Support
Sorry wasn't clear. What I meant was that you can add pages (e.g. settings) under Admin - hence, out of reach of clients -
How do make a selectbox fieldtype with static values?
kongondo replied to alkahest's topic in General Support
Ahem, ahem http://processwire.com/talk/topic/4137-exclude-pages-from-pages-field-type-using-pagelistselect -
How do make a selectbox fieldtype with static values?
kongondo replied to alkahest's topic in General Support
I am assuming you want this for the admin and not the front end? Here you go: http://processwire.com/talk/topic/201-fieldtype-select-aka-drop-down/ -
Btw, let me clarify one thing; with the exception of "name" [not title] all PW fields are custom fields . The title field in the default install is also a custom field, included with the default profile and "marked" as a global field, hence its appearance everywhere.. How you go about this really depends on a number of things. For instance, do you want each of those projects to have a URL? If so, then each has to be a page. If not, they can all go in one page but that may not be very versatile. So, here's one way of doing it: Note that PW fields are reusable. Create an image field called whatever you want (as per the naming rules for fields). Configure it to either accept only 1 image or multiple depending on your needs. Let's call the field "image" [single image field] or "images" [multiple image field] Create a template file called "projects.php" Create a template and associate it with the "projects.php" template file. Add the "image" [or "images"] field to it. If you are using PW default install you will already have the title field attached to this template since it is marked as "Global". If you want a field to contain text, e.g. a write-up about your projects, then create a text area field and add it to this template. If you will have other pages not related to projects, you may want to group your project pages into one "container", i.e. under one parent. So, go ahead and create a page called "projects". You can make it use the template "projects" or another template [all depends on how you code your template file] For each of your 5 projects, create child pages under the parent page "projects". Call them whatever you wish. Make sure these child pages use the "projects" template. Edit the child pages as you create them, adding a project image [or images] depending on the type of image field you created above. Enter a title and save each page. Now comes the fun part. Go into your template file and use a PW selector to grab and display those project child pages. I suppose in your parent projects page, what you want are links to your 5 projects. The HTML is of course up to you. You could do something like this. $projects = $pages->find('parent=projects');// this will give you all the children of the parent project page with the title "projects". If you wont have a lot of projects, no need to place a limit here on the amount of results you retrieve. Now, the call above will retrieve an array (more than one result returned)...Traverse the array using foreach. With that single call, you have access to everything about those child pages - their custom fields, etc... So, we use foreach to traverse the array...E.g. foreach ($projects as $project) { /*do something. What you want to do depends on you. Do you want to echo the project pages' titles? Do you want to echo a thumbnail of their images? Have a read of the project walkabout in the wiki as well as have a look at the default PW install. If you are still stuck, feel free to ask. */ } Small Project walkthrough Hope this helps
-
@Soma...Thanks! Well you and the other "usual suspects" are squarely to "blame" for slowly turning me into a coder ! I have recently had the "aha" moment regarding module development; I couldn't agree more - PW makes it so very easy to develop modules! The API is consistent and there's tools for almost everything (well-done Ryan!). Looking at the module code written by you guys now makes much more sense to me. Teppo's write-up on Inputfields and Fieldtypes was one of the tipping points for me; that plus I looked up some really nice and short PHP OOP tutorials. Suddenly, it all made sense . I feel like I've learnt a lot in such a short time, thanks to you guys leading the way . Anyway, I will be doing a write-up sometime about my experiences in module development so watch this space. About "energy", incidentally, I was thinking about that recently; about that time when you feel you've "coded it all" and need something different to excite you. Anyway, I digress. Thanks for offering to test. Looking forward to your suggestions
- 33 replies
-
- 4
-
- crud
- handsontable
-
(and 3 more)
Tagged with:
-
Hi Meepz. Welcome to the forums and the wonderful world of PW Not sure how much you've read of the docs. You want to start there if you haven't. Things will then make a lot more sense. Selectors and page(s) variables are a must read . Check this part of the docs to know how to access images. This thread has links to great resources, tutorials and articles. OK, back to your question... If you had that image as inline in your text, then all you need to do in your template file is to echo echo $page->project; If you had the image in an image custom field that could only take one image, in your template file you could have: echo $page->project;//contains your text if($page->image) echo "<img src='{$page->image->url}'>"; //where image is your image field There are other ways to achieve this; I'm just giving you basic examples here..
-
creating new page in combination with a file upload
kongondo replied to blackeye1987's topic in Getting Started
Hi Blackeye. Welcome to PW and the forums Creating pages with upload: As for creating a page and adding images, you are on your way... call the method for creating a new page - new Page(); get its template get its parent add a title save add image save all via the API...Make sure to sanitize all your form values.. see the examples on this page: http://processwire.com/api/variables/pages/ wireUpload: See these http://processwire.com/talk/topic/1809-image-upload-via-wireupload/ http://processwire.com/talk/topic/3105-create-pages-with-file-upload-field-via-api/ http://processwire.com/talk/topic/197-import-images-from-file-system-using-the-pw-api/ There's numerous other examples in the forums . See also these snippets: https://gist.github.com/somatonic -
. Yeah, the editor can drive you crazy!
-
@Horst: Oh, so now we can talk? I understood your last post before the above to mean you needed space (content overflowing across various posts) to finish writing IManipulator's tutorial b4 we could start posting Congrats on this great achievement!
-
Hi all, Just to let you know that Wanze and I are now working on this (or rather, he's doing most of the coding and am doing the talking ). We concluded it was best to (first) develop a PW Handsontable class that other modules can load, configure settings and use its methods to render CRUD tables. This way, the class can be integrated into other modules as required, e.g. Batcher and use all or only some of its methods, e.g. limited CRUD, readOnly, etc. At this stage, this means that the module is primarily for developers since there is no UI to configure it. However, once the class has been tested, a Process Module should follow. You can follow the project here: https://github.com/wanze/PwHandsontable. Suggestions welcome, thanks!
- 33 replies
-
- 10
-
- crud
- handsontable
-
(and 3 more)
Tagged with:
-
I think if it is a new topic, you start a new topic unless it's closely related to the current topic. Another reason to starting a new topic, this one already had best answer. For those quickly scanning the forum for unanswered topics, the "new question" might be missed. Just my opinion
-
Ordering by date reversed, then time normal order
kongondo replied to adrian's topic in General Support
Would the topics below help? Maybe am not getting you http://processwire.com/talk/topic/3290-sort-by-date-range/ http://processwire.com/talk/topic/4124-where-to-find-description-of-eg-1-month-selectors/ -
Btw, do you really need both <br/> and \n? Don't they accomplish the same thing (the latter without being output on the screen)?
-
Phew! For a minute there I thought I had gone bonkers! Hehe . Glad it's working fine..
-
How to automatically set the value of a field?
kongondo replied to bytesource's topic in API & Templates
Aahh, I see., you want to grab it before the page is saved (i.e. just after you tell PW that you want to create a new page (GET)) rather than after it has been created (POST) which is what I referred to. Glad it's working now.. -
Seems like you did not add Hanna Code Text Formatter to that particular textarea field? Do this under DETAILS when editing the field
-
How to automatically set the value of a field?
kongondo replied to bytesource's topic in API & Templates
Check in Firebug? (Net) Actually, I think it is a post and not a get?, i.e. $input->post->parent_id POST http ://localhost/pw/pw/page/add/ The POST parameters are (note, Token is alphanumeric - not as below:)) TOKENxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx _pw_page_name testpage parent_id 1 submit_save Save template 43 title testpage -
Interesting...if there's interest in this and someone doesn't show us why this would not work, maybe we can start a new topic to discuss this? Just flesh out ideas, discuss drawbacks, advantages etc. This could become a non-core module. I'm getting ahead of myself though and haven't thought this through (e.g. searching the repeaters, memory resources, etc.)
-
The following could be of use? Scroll down for ideas about checking user... http://processwire.com/talk/topic/4116-best-way-to-structure-a-classifieds-site/
-
Some of the below could be of value to this conversation http://processwire.com/talk/topic/3998-your-deployment-process/ http://processwire.com/talk/topic/3245-current-local-development-setup/ http://processwire.com/talk/topic/2461-keeping-in-sync/ http://processwire.com/talk/topic/2975-team-development/
-
I'm at a loss . Let's here what the gurus say
-
Hmm...and guest can view the pages? (i.e. there are no restrictions to view them). Just baffled.. . Maybe am missing something here..