opalepatrick Posted August 24, 2014 Share Posted August 24, 2014 Not sure if I am approaching this right. Say I have a project page. Each project could have multiple organisations working on it. So I used a page fieldtype and this allows me to select the relevant organisation... if it exists. Then I saw that you could select the ability to add a new 'organisation' (page) in this case. This works fine if all I want to do is create a new organisation name, but how would I also add the other fields for the organisation like address, city, etc? As I said , I may be barking up the wrong tree, but any pointers appreciated. Link to comment Share on other sites More sharing options...
renobird Posted August 24, 2014 Share Posted August 24, 2014 I don't think that's possible to do with the add new from a page field. However, you can use markdown syntax in the description for your page field to add a "add new organization" link as part of the field description. Be sure to specify /processwire/page/add/?parent_id={parent-id-here} in the URL. There are other ways using modules and hooks of course, but they are more involved than I can post on mobile. Link to comment Share on other sites More sharing options...
renobird Posted August 24, 2014 Share Posted August 24, 2014 Of course, this still takes you out of context. So you might want to go the module route and load jquery magnific module and use &modal=1 in the URL as well. Sorry for the plain explanations, difficult to post code from a phone. Link to comment Share on other sites More sharing options...
opalepatrick Posted August 24, 2014 Author Share Posted August 24, 2014 Thanks renobird, much appreciated. I will shoot and have a look at those now. Link to comment Share on other sites More sharing options...
opalepatrick Posted August 25, 2014 Author Share Posted August 25, 2014 I have used jquery magnific before on other sites but this is a first as a module. Another first is using Markdown! Thanks renobird. So I have the correct link to open the add organisation link, /processwire/page/add/?parent_id=1032&modal=1 but at the moment it is not popping as a modal, just as a new tab. I can see Jquery Magnific as a core module but no other settings. Been hunting through the docs. Any idea what I am missing? Link to comment Share on other sites More sharing options...
kongondo Posted August 25, 2014 Share Posted August 25, 2014 (edited) I have used jquery magnific before on other sites but this is a first as a module. Another first is using Markdown! Thanks renobird. So I have the correct link to open the add organisation link, /processwire/page/add/?parent_id=1032&modal=1 but at the moment it is not popping as a modal, just as a new tab. I can see Jquery Magnific as a core module but no other settings. Been hunting through the docs. Any idea what I am missing? The link has to be given the class that will tell the javascript to open this in a modal. I have not used magnific but in fancybox in ProcessWire, I think the class was 'iframe'. Example code... "<a href='{$this->config->urls->admin}page/edit/?id={$test->id}' class='myClass iframe'>$test->title</a>" Edited August 25, 2014 by kongondo Link to comment Share on other sites More sharing options...
opalepatrick Posted August 25, 2014 Author Share Posted August 25, 2014 Thanks kongondo. Two things. Markdown afaik does not allow classes in links. Python style markdown does by following with a {: class="iframe"} but this does not work here. So I can't test iframe as a class at the moment. (That was the second thing ) Link to comment Share on other sites More sharing options...
kongondo Posted August 25, 2014 Share Posted August 25, 2014 (edited) OK, didn't read about the MD part. Have you also edited your .js? For info though, here's how Wanze did it in ProcessBatcher.js /** * Setup fancybox for page edits */ var h = $(window).height()-65; var w = $(window).width() > 1150 ? 1150 : $(window).width()-100; $('.batcher_edit').fancybox({ type : 'iframe', frameWidth : w, frameHeight : h });}); In the above the class 'batcher_edit' does the trick (even without using the parameter &modal=1) in combination with the class 'iframe' Edited August 25, 2014 by kongondo Link to comment Share on other sites More sharing options...
renobird Posted August 25, 2014 Share Posted August 25, 2014 Sorry about that, my posts where a little unclear. The markdown method won't allow for the modal (sorry if I unintentionally lead you down a rabbit hole there). I was referring to using a module and a hook to add the link to the field when using the modal. I'm short on time, but if you don't get it sorted out, I can dig up the code and post it. Link to comment Share on other sites More sharing options...
opalepatrick Posted August 25, 2014 Author Share Posted August 25, 2014 Aaah those rabbit holes. I can find them very easily on my own! Luckily I have processwire forums to get me out of them Thanks both. I should take a step back I think. Basically I have projects that have organisations that have contacts, amongst other things. They all have their own parent and page structure. If it was me coding it all with php and sql I would be fine, but I need to learn new tricks a la processwire style. So before I go any further, is using page field types the way to go here or am I backing myself into a corner. I am thinking that, I select an organisation with a page fieldtype (already done) then really would only want to select contacts from that selected organisation, or, again add a new contact but only to that organisation.There could be multiple organisations per project as well. It is a sort of crm light. I would have conversations relating to the project that would all be cross referenced etc. The only person using this would be me and I would like to just record the projects, organisations, contacts and conversations in the admin area. I can use all that separately for reporting, forms and follow up reminders after. So, is this a separate thread territory? Edit: I should be doing this all out on web pages instead of trying to shoehorn functionality into the admin area, shouldn't I? Link to comment Share on other sites More sharing options...
renobird Posted August 26, 2014 Share Posted August 26, 2014 I'm not really sure about the larger questions there. I think you could build this all in the admin (not frontend pages). I sounds like you might might want to make a process module. List all the projects and provide links to common tasks for each of them. Maybe just a simple admin table would be enough? Link to comment Share on other sites More sharing options...
opalepatrick Posted August 26, 2014 Author Share Posted August 26, 2014 Thanks a lot renobird. I am going to have a look at that and at process modules. I think I am trying to run before I can walk on this admin area. It is the 'pulling it together' in the admin area that I am vague on. So thanks a lot for the tips. 1 Link to comment Share on other sites More sharing options...
renobird Posted August 26, 2014 Share Posted August 26, 2014 I don't know how familiar you are with Process Modules, but I posted a quick example a while back. Once you get started, they are super addicting. You can build just about anything. 4 Link to comment Share on other sites More sharing options...
cstevensjr Posted August 26, 2014 Share Posted August 26, 2014 @renobird, I have to say thanks for making your post today. I read your post this morning and decided to finally create my first ever Process Module. It was easy and very addicting.' Best Regards, Charles 6 Link to comment Share on other sites More sharing options...
Martijn Geerts Posted August 26, 2014 Share Posted August 26, 2014 Welcome to the club Charles 3 Link to comment Share on other sites More sharing options...
renobird Posted August 27, 2014 Share Posted August 27, 2014 Glad to help. Now you can start picking apart all the other process modules and swiping all their good ideas. 1 Link to comment Share on other sites More sharing options...
opalepatrick Posted August 27, 2014 Author Share Posted August 27, 2014 Oh yes. This is exactly what I needed I can stay in the admin area for what I want to do AND filter, etc. using php and the API. I did build that first module. Fabulous. I am having a good look at other modules as well! Thanks renobird. 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now