-
Posts
1,358 -
Joined
-
Last visited
-
Days Won
16
Everything posted by elabx
-
Well now it does perfectly! But I don't know how I got yesterday to a bunch of 404 pages. If I come accross the situation again I'll let you know.
-
Hi! @Mike Rockett the documentation pages for Jumplinks seem to be down, will you upload them somewhere else again?? Then again, thanks for this awesome module. EDIT: Whoops, right here: https://jumplinks.rockett.pw/
-
How to create a copy URL Fieldype?
elabx replied to Thomas Diroll's topic in Module/Plugin Development
Sounds to me like a good option is the RuntimeMarkup module, so you can basically render whatever you want in the inputfield, and add the necessary javascript to do the whole copy-paste to clipboard. -
So you didn't integrate the shop into the PW website in the end? (I remember you were looking for a solution). What stopped you from doing it? Just curious here ? Great work!
-
Internal Server Error 500 - Strato Shared Hosting
elabx replied to AndreasWeinzierl's topic in Getting Started
Anything on the error log on site/assets/logs/error.txt? -
That looks like some hipster god stack haha
-
[SOLVED] $page->field->title doesn't want to
elabx replied to BFD Calendar's topic in API & Templates
Ar the fields set to save single pages? -
Display entries depends on having an id/item in it ...
elabx replied to August's topic in General Support
Hi August! I had a bit of a hard time understanding your post, but I think you are trying to get pages with has a page field filled, then, assuming your field is called group: $selection = $pages->find("group!=''"); It's very rare to use SQL statements in ProcessWire unless you are thriving for extreme optimizations. -
Hook: Populate field value and don't save on error
elabx replied to Susticle's topic in General Support
What if you set the hook to happen before? -
How to add a button after determined field on a page edit form?
elabx replied to Jacek's topic in Module/Plugin Development
Hook it in your in the inputfield's render's method: $this->addHookAfter('InputfieldText::render', $this, 'addButton'); In the addButton method, check for the field's name, so it doesn't render everywhere. -
[solved] Displaying Content based on "user"
elabx replied to louisstephens's topic in API & Templates
For this to happen you must be using somewhere the $user variable which is the one that refers to the user in session. I'm thinking this is what you are looking for, so when Bob is logged in, $user will refer to Bob, and when Amy is logged in, it will refer to her user: $current = $pages->find("template=secondary, page_author=$user"); -
Yes, you have to check if the page you are trying to reference exists, if not, create it through the API. For educational purposes, you can check how InputfieldPage does it. See how it iterates through the titles it receives as input, and makes decisions based on the page already existing or has to make a new one. https://github.com/processwire/processwire/blob/master/wire/modules/Inputfield/InputfieldPage/InputfieldPage.module#L840
-
Possbile to list all options (and set current selected option)
elabx replied to louisstephens's topic in API & Templates
Use this to get all the options, iterate on it and just check if the value equals the page field value: $field = $fields->get('countries'); $all_options = $field->type->getOptions($field); Check the documentation for more useful on select options fields: https://processwire.com/api/modules/select-options-fieldtype/#outputting-selected-options-on-a-page -
You cannot delete the pages directly from javascript, you have to make a call to the server. My recommendation from what I can tell from your module, is to turn the list of checkboxes into an actual form: $out = "<form action='.' method='post'>; Remember to close the form tag and also add a button for submit! Check the boxes, click the submit button an there goes the request to the server. You then check on your execute() method for the comment input like: public function ___execute() { if(count($_POST['comment']){ foreach($_POST['comment'] as $comment){ wire('pages')->delete($comment); } } //rest of the code One difference here from what I read on your code, the wire() function which holds all the PW variables you are used to use on templates. After you delete them, the rest of your logic can stay the same, as it will only find the pages that haven't been deleted.
-
Quickiest/dirtiest I can think of is adding extra javascript to the admin pages and trigger the click on the tabs: http://soma.urlich.ch/posts/custom-js-in-processwire-admin/
-
For starters it appear that you would need ImageMagick installed on your server to make the format conversion. If time is an issue, I'd use two fields paired up in repeaters, or pages themselves, so the user can upload the pairing of jpeg and the tiff file. Though I understand making the user convert/upload the image is a pain point ? You could add a method to the Pagefile class through a hook like this: https://github.com/fbg13/FieldtypeFileS3/blob/master/InputfieldFileS3.module#L21
-
Try: $rep = $ref->repeater_field->get(1222); It should get the you the repeater item with ID 1222. This is a RepeaterPage which is pretty much a normal Page object. I don't have very clear how you know which repeater item you want to edit and where are you getting the data that is meant to be set on the repeater items. Every repeater field is an array of pages, where you can also use the find/get methods to match pages through selectors. Also, every repeater Item can have it's fields set and saved pretty much the same as normal pages.
- 1 reply
-
- 2
-
-
@Uniteam Anything showing on your logs? Under Setup > Logs.
-
Sorry, my bad, understood the problem wrong from the beginning. Just tested a similar code on an installation I have. I think this line should fix it i think you where trying to get the value from $f which is just the Field object data. $rdata[$f->name] = $field->get($f->name);
-
I think you are iterating the repeater items assuming they are like fields, so when you assign $rdata, the array is indexed by the page name (each item being a name), and $f->get($f->name) is trying to get a field, but by using a page ID, maybe that's why it's not getting anything.
-
$p = $pages->get("/".$pageId."/"); I think with this syntax you might be trying to retrieve a path with the ID, which i don't think will work unless your page name and tree location actually matches the Page ID, try just getting it like this: $p = $pages->get($pageId);
-
Try setting template_id as an integer: $field->template_id = $templates->get("mm_state")->id