-
Posts
2,765 -
Joined
-
Last visited
-
Days Won
40
Everything posted by Macrura
-
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?
-
@mike62 1) no need to remove ProCache 2) you should be logged into your admin when you are developing or trying to see uncached pages 3) make sure to add body class to cached pages so you can tell what is going on 4) install and use Tracy Debugger 5) make sure you have both wire_challenge and wires_challenge cookies in PC settings 6) if you for some reason do need to see the site when not logged in, add a get var, like ?nocache to the end of the url by the way, what happened to your admin - it looks like the admin from a much earlier version of PW. You should check to see if your user has an admin theme selected... By the way, i have never had to do any of the things you list, and work on live sites around 20 hrs a week.
-
@adrianromega - thanks for taking it for a test drive, and identifying that problem! I ended up rewriting the method that extracts the inputfields and now it should work a lot better thanks to your testing of that scenario.
-
ok i think i have fixed this, and improved the extraction process for the inputfields. Can you try the latest version?
-
you achieve that using the simple html dom parser, just have it scan for the anchors; the Process Documentation module has an example that will do exactly what you need; you can download a copy of the simple html dom parser and put it somewhere you can include it, and then process the body field as is shown in the example... https://github.com/outflux3/ProcessDocumentation/blob/master/examples/uikit-example.php
- 14 replies
-
- 2
-
- table of content
- anchor
-
(and 1 more)
Tagged with:
-
yes.
-
Since i typically maintain separate pages for those types of media (in a media library for every site), it is just a matter of setting up page select field. I use selectize so that the user can see what they are selecting. Also if i use a page for logo, then they can update the logo from the media library without having to change the setting; or they can add several logos to the media library and then select which one to use on the settings page. I don't yet know how to support image/file fields natively in this module, although since the settings pages themselves are pages of template admin, it might be possible. I was actually able to use both image and file fields and upload an image, however there are still errors with the value of the inputfield not yet working... In other news, here are some new screenshots of settings panels using UiKit theme, including a working example of using WireTabs:
-
there is no dashboard for PW. If you login though, you would see the page tree, that's the admin landing page. I would never permit a client access to changing the site's global base font. As mentioned in posts above this could have not only detrimental effects to the layout of all content elements, but would also be virtually impossible considering that many parts of the base css file (global style for example) may have rules that refer to that loaded web font. If this ability for base font to be selectable in admin was a requirement of the project, then i would neutralize all of the font rules in the css, and place 1 style tag in the header, which would be selected using some settings page (settings factory or custom helper module), this selection would also have the effect of loading the correct webfont (i use webfonts.js for font loading)... so to sum up, yes it is definitely possible to grant control of the global base font for a site to a settings page with the right modules, and code in the header, but whether it would really work is questionable; You also might need to account for 2 fonts, since most sites use 2-3 complementary webfonts each optimized for either headings or body text..