-
Posts
2,776 -
Joined
-
Last visited
-
Days Won
40
Everything posted by Macrura
-
@tprThe docs say: If your parent page(s) are not already sorting by a specific field, you may still tell the $pages->find() to sort by the parent's order by specifying "sort=sort" in your selector http://processwire.com/api/selectors/#sort so i would guess that all you need is sort=sort, and not the way you suggested (?)
-
sorry must have not gone through, just pushed it now. I'm guessing the mods dir is having the same leading zero problem, possibly running php 7 since v 003, when leading zeros used to work... hoping this does fix that.
-
Ok sorry about this – i just change the leading zero integer to a string so we'll see if that fixes the download install... I regularly use this module instead of the core image tagging, so that i can have those benefits i listed somewhere, in short, key/value pairs for tags and template context for different tags on a field..
-
@tpr yes - i noticed this during testing and actually added sort=sort to the selector; do you think it is better to use your version?
-
preview of upcoming version with some new features: 1) upcoming version lets you place the prev/next links either in the tabs area or in the breadcrumbs (so far only on UiKit): so they look like this (using native UiKit classes): the labels go away for smaller screens: also, supports wrap-around pagination for first and last items: Overall i like the pagination up there in the right of the breadcrumbs, better than down in the tabs; This is only possible currently on UiKit theme, because the breadcrumbs are hookable; thanks to @tpr for the idea of the wraparound pagination, and the idea of moving the links out of tabs; The new version of AOS also has an option for page navigation and is a great alternative to using this module. this implementation is different in that it is using a hook and changing the markup, rather than adding the links by javascript; also this implementation does allow you to selectively show prev/next pagination based on the template, and the placement of the links it static, in the upper right, whereas the AOS version would move around next to the title. Also this version tooltips the titles of the linked pages. Edit: The links can now also be moved on Reno Theme:
-
How To Use PW API With Other PHP Scripts?
Macrura replied to Mustafa-Online's topic in API & Templates
i don't really fully grasp what the setup is, but you definitely shouldn't put anything inside the wire folder. I'm guessing this is a separate script that is used to create/edit slides; it should work completely fine in the root directory, i use a few separate scripts like that. -
this is great! the only issues i see with the links being next to the title is that they will jump around from page to page, whereas if they stay in 1 place, you can click through the siblings without moving the mouse. I like the fact that it goes back to the beginning/end also – that's helpful..
-
ok thanks for the alert - i put quotes around it and upped to 009..
-
@cstevensjr the latest version of the prev/next tabs fixes the issue between the help tab and the prev/next tabs. Also the newer version of the Admin Help module has some fixes; i'm still working on further updates to that module but the latest version on GH should fix some oddities.
-
Textformatters are applied when the field is output on the frontend, or when you echo the content somewhere (with output formatting on). in terms of how you'd get the image attrs of the actual image, i think you'd be getting the filename and then looking it up in the images field; there is no JS involved, just native dom parsing or using simple_html_dom; you wouldn't even need a textformatter for this, you could just process the field at the template level; there are several modules that do this, like the import external images; if/when i get around to making the AMP pages i will post the code on it (if i'm able to do it!)
-
if you are not going to build your own, using PW data and frontend libs like fullcalendar, then you may want to look at this: http://modules.processwire.com/modules/inputfield-recurme/
-
don't you need to call $new_option->of(false); before saving?
-
PW3 - Display Site Preferences Field Content
Macrura replied to ridgedale's topic in API & Templates
or $sitePrefs = $pages->get("template=sitePreferences"); echo $sitePrefs->siteChairperson; //etc..- 4 replies
-
- pw3
- site preferences
-
(and 1 more)
Tagged with:
-
the only problem with overriding the core pwimage plugin is keeping up with changes to the core, otherwise, if it works, and you are not planning to upgrade the core, then that should be ok... I'd say my first instinct in this situation would be to use a textformatter, and then be able to manipulate the elements in the ck editor field; You could use dom parsing and then should be able to add those attributes, though i haven't tried this yet (but will be doing so soon for a site that needs AMP pages)... i have used image interceptor in the past, (http://modules.processwire.com/modules/textformatter-image-interceptor/ ) Not sure if it works on 3x branch, i think i had to fix some things in that for a site i upgraded to 3x, but never logged my changes, just fixed some errors and let the site work.. This is a new module that manipulates images, so possibly having a look at if you were going to make a textformatter... ( http://modules.processwire.com/modules/textformatter-fluid-images/ )
-
ok sure - thanks for using and testing these; another small change may be needed once it is tested with the latest version of AdminThemeUIKit, based on some info in the blog post.
-
@cstevensjr what was the issue - there are some hacky assumptions with the prev/next tabs, in that they are the last 2 tabs; it's possible that might not always be the case; I will try and see what it looks like with the admin help tab module – it is possible that the combination of those 2 modules may not work right at the moment, may need to force the prev/next tabs to the end or something..
-
The module should work ok now on AdminThemeUiKit. The only issue is if you try and use a narrow/mobile view, the tabs may overlap, b/c to get them to be on the right, they have to be absolutely positioned.
-
I'll try and fix the css to work on UiKit; in the meantime if the prev/next links make it into AOS that would be great, and 1 less module to install and worry about configuring on new sites...
-
the input form is all native PW; so you just supply your array of field definitions using the correct keys for that inputfield type; no graphical ui would be possible, but there is a kitchen sink file where you just grab the type of inputfield you want, paste it in to your fields array, change the settings and bob's your uncle.
-
Yeah, i haven't found any way to do repeatable content yet, but it could be possible to roll your own multiplier field using text inputs and some javascript. If i get around to that i will post how it is done..
-
It is probably limited to the types of fields you can use generally in module configs, and currently there is no way to handle custom processing of form data, it uses the default $form->process() function from the core; If there are any specific fields you want to test let me know and i'll give them a go; The obvious ones that won't work are files and images, as well as any profileds like tables, repeaters and stuff like that;
-
if you check out my solution above, it does do exactly what you need, and in UiKit; it also has the added benefit of being able to add UiKit classes to your lists, tables, and first paragraph...
- 14 replies
-
- 1
-
-
- table of content
- anchor
-
(and 1 more)
Tagged with:
-
Also, for the field to work in lister/lister pro, some additional changes needed to be made to how the links to the download are formed; this is the complete hookRenderItem method; so basically instead of referencing the page being edited, it would need to reference the $pagefile->page; then since the editUrl already has the id, you don't need to have that in the $segments array.. this works now in listers if you show a secure files field, when it renders in the list you can click on the item to download/view the file... public function hookRenderItem(HookEvent $event) { /** @var PagefileSecure $pagefile */ $pagefile = $event->arguments('pagefile'); if (!$pagefile instanceof PagefileSecure) { return; } $markup = $event->return; $markup = preg_replace("/<a class='InputfieldFileName'[^>]*>(.*)<\/a>/", "$1", $markup); if ($pagefile->field->get('allowDownloadInAdmin') && $pagefile->isDownloadable()) { $segments = array( //'id' => $this->wire('input')->get('id'), self::GET_VAR_DOWNLOAD => urlencode($pagefile->basename), ); //$link = $this->wire('page')->url . '?' . http_build_query($segments); $link = $pagefile->page->editUrl . '&' . http_build_query($segments); $markup .= "<div class='FieldtypeSecureFileDownload InputfieldFileData'><a href='{$link}'><i class='fa fa-download'></i> " . $this->_('Download File') . "</a>"; $segments['view'] = 1; //$link = $this->wire('page')->url . '?' . http_build_query($segments); $link = $pagefile->page->editUrl . '&' . http_build_query($segments); $markup .= " | <a href='{$link}' target='_blank'><i class='fa fa-eye'></i> " . $this->_('View File') . "</a>"; $markup .= "</div>"; } $event->return = $markup; } after additional testing, i can consider forking and pull request, but wanted to run this by here on the forum first.. also haven't setup a module config to account for the showing pref (view and or download).. will possibly get to that soon..
-
I needed a way for the files to not force download, so that admin users can quickly view a document in their browser; i added this to the hookDownloadFile() method: $options = []; if($this->wire('input')->get('view')) { $options['forceDownload'] = false; } and then added options to the download: $file->download($options); // Access check performed by this method up in the hookRenderItem i added this: $segments['view'] = 1; $link = $this->wire('page')->url . '?' . http_build_query($segments); $markup .= " | <a href='{$link}' target='_blank'><i class='fa fa-eye'></i> " . $this->_('View File') . "</a>"; $markup .= "</div>"; so now the file looks like this: It would be cool to consider adding this functionality, since it can't always be assumed that the files should force download; maybe it needs to be a config option where you choose the behavior or opt in for download and/or view links...
-
Doh! ok, i guess scratch #4 (don't think Tracy works on that version).. why not upgrade though, at least to 2.7.3?