-
Posts
2,766 -
Joined
-
Last visited
-
Days Won
40
Everything posted by Macrura
-
reusable block across multiple pages of same template
Macrura replied to DarsVaeda's topic in API & Templates
the question is also, when you say editable, should the edits made to the reusable block be singular across the site (meaning if you edit the block on one page, should it change for all pages), or did you mean that the reusable block, if edited, that those edits only apply to the page where you have edited it. if the former, then the answer to this: would be a page reference field. -
you should post in the correct place:
-
this also may help:
-
There is no module i know of that can import external content, it is also somewhat complicated unless you know that the contents of the wikipedia page have some structure you can parse and get only the main text; typically for something like this you would use the simple html dom parser and using a module/hook on save for that template and then put those contents into your body field... you'd have to probably write some logic to get only the part you need, using the dom parser api another concept is to copy the page and paste it into your body field manually, and if you use the ImportExternalImages module, it should grab all of the images and add them to your local site.
-
yep, that's what i forgot to recommend.
-
one way would be with jquery; another way would be with a textformatter applied to the rte field, in which you could use something like simple html dom parser, to wrap those....
-
numbers do work fine in url segments; there must be something going on with your selector, and either some type mismatch, or other issue with the selector; do you have tracy debugger installed? you can run a series of tests on your selector to make sure it is returning results, and also dump/log the segments or sanitized segments to see what is going on
-
what version of PW are you running, and have you tried removing the namespace from the functions file.. you could also just modify the function.. renderNav(ProcessWire\PageArray $items) or just renderNav($items)
-
sounds like a namespace issue - are all of the files related to this all namespaced?
-
Non db dependent 'offline' page - for when pw cant reach the db
Macrura replied to robinc's topic in Wishlist & Roadmap
one thing that is not working for me with the offline files in the template folder: it seems that if you use delayed output, then there is something in the output buffer already that gets prepended to the html file when rendered; not sure how to fix this, but it's kind of a problem, can't render a clean 500 error page because of this, due to a bunch of markup being output above the opening <html of the error file... -
it's a really amazing module, and will be indispensable for any site using hanna codes, i can already see this solving major problems with users entering incorrect stuff into their hanna codes. the options and description stuff is also amazing work!
-
it's working well so far... the only error i encountered was because the hanna code module config may not even be populated if you install hanna code and use the defaults, and never actually save the module, so one option would be to also check if the index for that module config is set, (around like 150 of the module)...
-
Different styles for results of an array (page grid)
Macrura replied to MilenKo's topic in API & Templates
it's pretty simple, you just set a counter before the loop and increment it at the end of each loop increment... then you can use that incremental counter to conditionally add a class where needed. for example: $count = 0; foreach($items as $item) { $class = ['default-class']; if($count == 2) $class[] = 'some-other-class'; $classOut = implode(' ', $class); // echo your div with the imploded classes.. $count++; } -
How to show message in backend when user choose a certain field value
Macrura replied to Gideon So's topic in General Support
the last post was just how to do it in formbuilder, so not relevant, and i removed that link... -
How to show message in backend when user choose a certain field value
Macrura replied to Gideon So's topic in General Support
@Gideon So the way that i have handled this in the past was to use an extended version of the select, which adds a data-description atttribute to the selectable items. Once you have that attribute (which would get it's value from a data-description field), then you can use jQuery to replace the description with the new value, once it is selected. these topics may be of help: -
field 200+200+200 Field-Text/url/textarea into 1 Template
Macrura replied to franciccio-ITALIANO's topic in Getting Started
Hi - I'm totally not following your post. However, based on your 2nd sentence, this would be my answer: Create template called plant add 3 fields Title (default) Type: textarea; Title: Description (optionally use CK editor) Type: page reference; Title: Page Select (page_select); configure this to select the link to another page Create template called plant-index one field, title; configure the family settings to allow children of template plant configure the allow new pages to 1 Create a new page using this template Go back to plant template and family settings, no children and plant-index for allowed parent Go to the page tree and hover over the Plant Index, then 'new' - this will give you a new plant Add your title, description and select the page you want to link to, save Repeat steps 4-5, 199 more times. -
sorry about the module mixup..
-
it would probably need to be part of a site profile so that it could make sense, it also integrates with 3 other modules, ProcessGeneralSettings, SimpleSiteEngine and SimpleSiteMeta, which together complete the whole frontend api that i'm trying to develop...
-
sure, so the (currently named) SimpleThemeEngine is basically a front end api, which is now in module form, but was previously a loose collection of functions that were used procedurally. I would probably recommend to use Spex since it released and proven to work; My module is probably too specific for general release at the moment... It uses WireData class for storage and provides methods for: Adding, manipulating assets (css/js) outputting assets (css/js) Getting and setting theme variables/settings (used for layouts, like show/hide page header, etc) injecting inline js code in head/foot simple web fonts management, loading etc injecting markup into parts of the page (sort of layout hooks) problem with releasing module is that it depends currently on ProCache being installed (future version would have setting to select the caching/min engine, e.g. AIOM or PC)... below is an example of the code that would be used in the head.... // $ste = $modules->get('SimpleThemeEngine'); echo $ste->headAssets(); echo $ste->getJsConfig(); echo $ste->gFontLoader('Open+Sans:300,400italic,400,600,700|Montserrat:700'); echo $ste->getInjects('header');
-
you can use arrays in selectors now, or if you prefer you can setup the selector parts in a plain array and then implode it with commas , into a variable, e.g. $selector. also, i believe to make the logic work in your selector, you may need to use OR groups https://processwire.com/api/selectors/#or-groups you can't do the separate lines within the selector because there would probably be 'junk' like \n, \s, and possibly \t
-
Haven't used emo in a while, but you can just call whichever function you need to on the callback... "drawCallback": (function() { emo_replace(); }),
-
yes, for some projects, i use html themes, like from html5 up, themeforest, wrap bootstrap etc..
-
I use themes (both commercial and free), don't see any issues with it. I use a custom theme engine module that sort of speeds up the whole process of integrating a pre-made design... (from any html source)