-
Posts
2,321 -
Joined
-
Last visited
-
Days Won
44
Everything posted by tpr
-
There's a module for this
-
MarkupSEO - The all-in-one SEO solution for ProcessWire.
tpr replied to Nico Knoll's topic in Modules/Plugins
What kongondo wrote is right but unfortunately this doesn't work in MarkupSEO (at least I couldn't get it to work). Fortunately it's very easy to override values because all seo fields are real fields: $page->seo_title = $page->seo_title . ' - My custom suffix here!'; And you can do this with all the MarkupSEO fields. To set a new value for the og:image, modify the "seo_image" field (untested). -
Check whether you have anything echoed before the starting "html" tag (view source in the admin)
-
In my project users should not see the extra breadcrumbs, though it's not a problem if they do. So I can live with it as it is
-
Just popped in to say that the module works pretty well. I've set up roles and permissions (which was a huge work), and I could achieve a state where everything is working as it should on the site. The only glitch I see is that when editing a page (with a restricted branch user), the breadcrumb on the top shows items above the restricted branch too: Home -> Page1 -> Page2 (ARB top level) -> Page3 (-> Page4 under edit) "Home" and "Page1" should not be visible as they are above the restricted branch. Fortunately clicking on them goes to the restricted branch top, so no harm is made. On the top level the breadcrumb is OK.
-
Sure, but that's true for every field in the admin
-
I use MultiValue Textformatter for such cases. Mainly for social links, contact data and such. http://modules.processwire.com/modules/textformatter-multi-value/ https://processwire.com/talk/topic/10827-multivalue-textformatter/
-
There was a similar discussion here in the forums which I can't find now, someone even suggested a module for this purpose
-
The module is not yet in the Modules directory but will be as soon as I FEEL it's stable enough (to be released as Beta ). I used it only in smaller projects so far but now I can test it on a multi-user site, so I expect hidden issues will come to surface. Plus I plan to add a few major feature (eg. add new page) so I will add to the directory when everything falls into place.
-
v1.1.9 is out with a few important fixes and one small but handy feature: toggle edit link display using ctrl+shift hotkey. The module configuration was largely rewritten so please report if something goes weird. Main changes: - do not add Magnific Popup assets to admin (suggested by Matjaž) - fixed missing default values on module install - fixed default editlink text override issue - fixed: do not try to open Template editor if not SuperUser - added ctrl+shift hotkey to toggle editlink display - sanitize module settings inputs Btw, is template editing only available for SuperUser? I found no info on that so limited this feature only to them.
-
Repeater field usability; reverse order/collapsed items
tpr replied to a-ok's topic in General Support
In the same manner you could tweak css to add the Add item button to the top. I'm not sure if this is the best way to achieve this but it works, and perhaps with the fewest side effects. -
Repeater field usability; reverse order/collapsed items
tpr replied to a-ok's topic in General Support
Indeed, just tried. It has the benefit that it needs to be added only to the parent element. -
Repeater field usability; reverse order/collapsed items
tpr replied to a-ok's topic in General Support
I wonder that the simple css3 trick could help here: flipping the whole repeater container and also the individual repeater items (using transform: scaleY(-1)). So the list would effectively get reversed. Will try it later on PC. Update: just tried and it works fine. New items added to the top, even before save (visually only, of course). -
I was using only LESS in my projects through PhpStorm's LESS plugin. It did the job fine until I wrote a mixin that required LESS version 1.6.2, and the plugin supports 1.6.0 only. So I took the chance and set up Node and Gulp to see the difference. And there's a huge difference! First off, my mixin works fine. Second, I could automatize many things that I did manually beforehand, and even add new things to my workflow. I used Base's gulpfile.js as the starting point but added some new stuff too. - watch: compile CSS when a LESS file is changed (saved) - less: compile LESS to CSS - uncss: remove unused CSS from stylesheets. Great to reduce CSS file size when using bigger CSS frameworks. - minify, nano: minify JS/CSS/HTML - imagemin: reduce image file size - copy: create a release package out of source files - inlinesource: add CSS inline These tasks helped a lot to achieve 100/100 on google page speed on a current project (one-page landing page). It takes some time to set up gulpfile.js but when it's done, subsequent runs saves a lot of time. I'm on Win and had some initial troubles setting up PATHs (environment variables), but finally everything came into place. I also use Node.js Portable Runtime so I can use Node in a portable manner without the need to install globally.
-
What caught ny eye is the logo - I like the colors! The site is also decent, nicely done.
-
I know it's only a recommendation but wanted to know if there's a reason that I'm missing. (seems no) I've set up the PHP coding style in PhpStorm according to the style guide and almost everything was similar as my personal preference, except the quotes (partly).
-
I see your points, thanks. I also use PhpStorm and yes, variables are highlighted in such cases too. Consider this: $editUrl = "data-mfp-src='{$page->editUrl}$lang&modal=1'"; $editUrl = 'data-mfp-src="' . $page->editUrl . $lang . '&modal=1"'; The first will result in single quote html tags and it is less readable imho. The second results in double quotes and for me it's more readable and separated. The first will most likely cause mixed quotes in html tags if you view the whole site's source. I know it's not a big deal but it doesn't seem logical to me. One should write single quotes for html tags in all his template files to avoid mixed quotes. Of course this is only my opinion, perhaps because I'm coming from the front-end side.
-
The style guide is here: https://processwire.com/api/coding-style-guide/ However, I don't get why are double quotes recommended for strings echoed here: https://processwire.com/api/coding-style-guide/#8.1-single-vs-double-quotes Doing so will result in such html: <link rel='stylesheet' media='screen' href='style.css'> Which is perfectly valid but in most cases double quotes are used for html tags - at least I think so. Following the style guide will likely result in mixed html quotes on a site. I also see that variables may be easier to add if the string is encapsulated in double quotes. However, editors and IDEs can higlight variables better if they are concatenated, and they are easier to spot. Just asking.
-
Some improvements in the JS: $(window).load(function () { var fieldName = 'tags_recipe', // add field name here limit = 5, // set limit here asmSelector = '#Inputfield_' + fieldName; $(asmSelector).on('change limitItems', function () { var obj = $(this).parent().find('.asmSelect'); $(this).find(':selected').length >= limit ? obj.attr('disabled', 1) : obj.removeAttr('disabled'); }); $(asmSelector).trigger('limitItems'); }); What would be nice is to add the "limit" in the backend to the asmSelect using a "data-limit" attribute and then let JavaScript do its part on all asmSelects which have data-limit set.
-
Or use window.load() inside document.ready() to make sure http://stackoverflow.com/questions/5006922/window-load-inside-a-document-ready
-
I see, but in ready.php the $page is already determined, isn't it? This snippet actually works: // content in ready.php if ($page->template != 'admin') { $wire->addHookAfter("Page::render", function (HookEvent $event) { echo <<< HTML <script type="text/javascript">alert('Hello world');</script> HTML; }); } I guess it's because it hooks to Page:: render.
-
Possibly related: https://processwire.com/talk/topic/5889-image-quality-problem-on-resize/?p=57521
-
I wonder if it's better to wrap the whole hook in such a condition: if($page->template === 'basic-page') { $wire->addHookAfter(...) }
-
Getting random values out of a computer is not that easy