kalimati
Members-
Posts
61 -
Joined
-
Last visited
Everything posted by kalimati
-
Hi, For a Page Reference Field I would like to use filter something like this: parent=$pages->findOne("template=mag-issue, sort=-created") But I am not able to get it to work using the various options available to define selectable pages. Any idea where I could be going wrong or how to approach it. Thanks.
-
RockNette - Wrapper to integrate Nette Framework into ProcessWire
kalimati replied to bernhard's topic in Modules/Plugins
It is a namespace issue. Changed the reference to makeUIkit to: $form->onRender[] = 'processwire/makeUIkit'; -
RockNette - Wrapper to integrate Nette Framework into ProcessWire
kalimati replied to bernhard's topic in Modules/Plugins
HI Bernhard, Thanks for the module. Looks interesting and worth exploring. I am trying it out but running into a problem while using a rendering function for UIkit, adapted from the makeBootstrap4 one used on the Nette site as an example. I get the error: Call to undefined function makeUIkit(). Any idea where I may be going wrong. Thanks. namespace ProcessWire; use Nette\Forms\Form; function makeUIkit(Form $form): void { $renderer = $form->getRenderer(); $renderer->wrappers['controls']['container'] = null; $renderer->wrappers['pair']['container'] = 'div class="uk-margin"'; $renderer->wrappers['pair']['.error'] = 'uk-form-danger'; $renderer->wrappers['control']['container'] = 'div class="uk-width-2-3@s uk-form-controls"'; $renderer->wrappers['label']['container'] = 'div class="uk-width-1-3@s uk-form-label"'; $renderer->wrappers['control']['description'] = 'span class="form-text"'; // non uikit $renderer->wrappers['control']['errorcontainer'] = 'span class="form-control-feedback"'; // non uikit $renderer->wrappers['control']['.error'] = 'is-invalid'; // non uikit foreach ($form->getControls() as $control) { $type = $control->getOption('type'); if ($type === 'button') { $control->getControlPrototype()->addClass(empty($usedPrimary) ? 'uk-button uk-button-primary' : 'uk-button uk-button-secondary'); $usedPrimary = true; } elseif ($type === 'text') { $control->getControlPrototype()->addClass('uk-input'); } elseif ($type === 'textarea') { $control->getControlPrototype()->addClass('uk-textarea'); } elseif ($type === 'select') { $control->getControlPrototype()->addClass('uk-select'); } elseif ($type === 'file') { $control->getControlPrototype()->addClass('uk-input'); } elseif (in_array($type, ['checkbox', 'radio'], true)) { if ($control instanceof Nette\Forms\Controls\Checkbox) { $control->getLabelPrototype()->addClass('uk-checkbox'); } else { $control->getItemLabelPrototype()->addClass('uk-radio'); } $control->getControlPrototype()->addClass('form-check-input'); $control->getSeparatorPrototype()->setName('div')->addClass('form-check'); } } } $states = [ 'Andaman & Nicobar Islands' => 'Andaman & Nicobar Islands', 'Andhra Pradesh' => 'Andhra Pradesh', 'Arunachal Pradesh' => 'Arunachal Pradesh', 'Assam' => 'Assam', 'Bihar' => 'Bihar', 'Chandigarh' => 'Chandigarh', 'Chhattisgarh' => 'Chhattisgarh', 'Dadra-Nagar Haveli & Daman-Diu' => 'Dadra-Nagar Haveli & Daman-Diu', 'Delhi' => 'Delhi', 'Goa' => 'Goa', 'Gujarat' => 'Gujarat', 'Haryana' => 'Haryana', 'Himachal Pradesh' => 'Himachal Pradesh', 'Jammu and Kashmir' => 'Jammu and Kashmir', 'Jharkhand' => 'Jharkhand', 'Karnataka' => 'Karnataka', 'Kerala' => 'Kerala', 'Ladakh' => 'Ladakh', 'Lakshadweep' => 'Lakshadweep', 'Madhya Pradesh' => 'Madhya Pradesh', 'Maharashtra' => 'Maharashtra', 'Manipur' => 'Manipur', 'Meghalaya' => 'Meghalaya', 'Mizoram' => 'Mizoram', 'Nagaland' => 'Nagaland', 'Odisha' => 'Odisha', 'Puducherry' => 'Puducherry', 'Punjab' => 'Punjab', 'Rajasthan' => 'Rajasthan', 'Sikkim' => 'Sikkim', 'Tamil Nadu' => 'Tamil Nadu', 'Telangana' => 'Telangana', 'Tripura' => 'Tripura', 'Uttar Pradesh' => 'Uttar Pradesh', 'Uttarakhand' => 'Uttarakhand', 'West Bengal' => 'West Bengal' ]; $form = new Form; $form->onRender[] = 'makeUIkit'; $form->addText('name', 'Name:') ->setRequired('Please fill your %label.'); $form->addEmail('email', 'Email:') ->setRequired('Please fill your %label.'); $form->addText('designation', 'Designation:') ->setRequired() ->setHtmlAttribute('class', 'uk-width-1-2@s'); $form->addText('company', 'Company:') ->setRequired() ->setHtmlAttribute('class', 'uk-width-1-2@s'); $form->addCheckbox('printed', 'Please send me the printed edition. Delivered within India only.'); $form->addText('address', 'Address:') ->setHtmlAttribute('class', 'uk-width-1-2@s') ->addConditionOn($form['printed'], $form::EQUAL, true); $form->addText('city', 'City:') ->setHtmlAttribute('class', 'uk-width-1-2@s') ->addConditionOn($form['printed'], $form::EQUAL, true); $form->addSelect('state', 'State:', $states) ->setHtmlAttribute('class', 'uk-width-1-2@s') ->addConditionOn($form['printed'], $form::EQUAL, true); $form->addInteger('pin', 'PIN:') ->setHtmlAttribute('class', 'uk-width-1-2@s') ->addConditionOn($form['printed'], $form::EQUAL, true) ->addRule($form::PATTERN, 'Please enter a valid Indian PIN code', '^[1-9]{1}[0-9]{5}$'); $form->addSubmit('subscribe', 'Subscribe'); ?> <script pw-append="html-head" src="https://nette.github.io/resources/js/3/netteForms.min.js"></script> <div id='content' class='uk-width-expand'> <div class="uk-child-width-1-2@m" uk-grid> <div> <?php $latest_mag = $pages->get("template=mag-issue, sort=-created"); echo "<img class='uk-align-center' src='{$latest_mag->images->first->url}' alt='{$latest_mag->title}' />"; ?> </div> <div> <h2>Subscribe!</h2> <?php $form->render() ?> </div> </div> </div> -
I have imported a table of articles and a table of authors. They are both connected via author_id field. How do I convert this link to Processwire native page reference field? Thanks.
-
AllInOneMinify ProcessWireUpgrade Duplicator E-mail Obfuscation Repeater (core)
-
Great tutorial. I had implemented something like this in 2018 using Hanna Code. I my case the website has a seperate gallery section and the relevant galleries are imported wherever needed at appropriate positions in articles. Example page: https://ashajsr.org/updates/udaan-girl-child-day-2019/
-
module PrivacyWire - Cookie Management & async external asset loading
kalimati replied to joshua's topic in Modules/Plugins
Thanks! How can I customise the HTML and CSS of the banner? -
It may have something to do with the graphics conversion engine installed. I corrected the problem on my local server by installing ImageMagick.
-
What about PNG images with transparency? The transparent areas are appearing as black in the webp images. Any special settings for those?
-
Thanks dragan. That must have been it. The cleaned code worked.
-
<?php /** * Program Listings * Included in Programs Template */ $out = "<div class='uk-grid-small uk-child-width-1-2@s uk-flex-center' uk-grid>"; foreach($page->children() as $program) { $out .= "<div>"; $out .= "<div class='uk-child-width-1-2@s' uk-grid>"; if (count($program->images)) { $firstImage = $program->images->first(); $firstImage->size(320, 240); $out .= "<div><img src='{$firstImage->url}' alt='{$firstImage->description}'></div>"; // Line 17 } else { $out .= "<div> </div>"; } $out .= "<div><p>$program->date</p><p>$program->headline</p><p>$program->body</p></div>"; $out .= "</div></div>"; } $out .= "</div>"; echo $out; ?> Can anyone please tell me why do I get syntax error, unexpected '' (T_STRING) on line 17? Thank you.
-
Thank you Soma. That was quick. You were right I had to install the Package Manager separately. Sorry about posting it here.
-
I have installed Duplicator and can access it's Settings page. But it does not show up in the following url sitename/processwire/setup/duplicator/ The error message is: ProcessWire: Unrecognized path Any Idea what could be wrong. I am using Processwire version 3.0.107. Thanks.
-
Thanks Adrian. I went with Option 7. Works well. I guess my mistake was keeping 'multiLine' -> true assuming it to be a pre-condition to paragraph formatting.
-
That is how I managed. I thought newlineReplacement would do the replacements. It wasn't so as the name of the option suggests. Thanks anyway.
-
I am using sanitizer->textarea to sanitize and format the message inputted. I've tried various options including newlineReplacement but have been unable to convert newlines to <br> tags. Although the PHP nl2br function works as expected. Any suggestions? Thanks.
-
Solved it. Had both versions, composer and direct download!!
- 76 replies
-
Compile Error: Cannot declare class Valitron\Validator, because the name is already in use (line 13 of /var/www/mydomain.com/public_html/vendor/vlucas/valitron/src/Valitron/Validator.php) I get the above error. Any idea why that should be happening?
- 76 replies
-
Can't we just use the images field as input for a Page type field? Each image has a description that can be use as a title?
-
Processwire allows us to define predefined tags for images. What if I want to use a repeater field on the page for the purpose? How can I use values of this repeater field as the list of available tags for image fields? Thanks.
- 2 replies
-
- images
- predefined tags
-
(and 1 more)
Tagged with:
-
Gallery: A photo album module (preview)
kalimati replied to kongondo's topic in Module/Plugin Development
Any movement on the module, kongondo? -
Admin Login Page after Foundation 6 Update
kalimati replied to kalimati's topic in Themes and Profiles
Thank you, gmclelland. That was it besides cleaning the cache. -
I have been updating an existing website on my local Ubuntu server. I updated the website from Processwire 2.5 to 2.8.62. No issues till this point. Then I created a new templates folder, installed Foundation 6, copied the old PHP template files and customized the SCSS files to rebuild the site. The frontend works without a problem. However, when I try to access the backend, the website/processwire url, I get this error message. Any idea what is wrong and how can I correct the issue? I made no changes to the backend theme. ======================================== Warning: fopen(/var/www/tribology/public_html/site/assets/logs/exceptions.txt): failed to open stream: Permission denied in /var/www/tribology/public_html/wire/core/FileLog.php on line 82 Fatal error: Exception: Missing or non-readable template file: admin.php (in /var/www/tribology/public_html/wire/modules/PageRender.module line 517) #0 /var/www/tribology/public_html/wire/core/Wire.php(383): PageRender->___renderPage(Object(HookEvent)) #1 /var/www/tribology/public_html/wire/core/WireHooks.php(698): Wire->_callMethod('___renderPage', Array) #2 /var/www/tribology/public_html/wire/core/Wire.php(442): WireHooks->runHooks(Object(PageRender), 'renderPage', Array) #3 /var/www/tribology/public_html/wire/core/WireHooks.php(782): Wire->__call('renderPage', Array) #4 /var/www/tribology/public_html/wire/core/Wire.php(442): WireHooks->runHooks(Object(Page), 'render', Array) #5 /var/www/tribology/public_html/wire/modules/Process/ProcessPageView.module(205): Wire->__call('render', Array) #6 /var/www/tribology/public_html/wire/core/Wire.php(383): ProcessPageView->___execute(true) #7 /var/www/tribology/public_html/wire/core/WireHooks.php(698): Wire->_callMethod('___execute', Array) #8 /var/www/tribology/public_html/wire/ in /var/www/tribology/public_html/index.php on line 64 Warning: fopen(/var/www/tribology/public_html/site/assets/logs/errors.txt): failed to open stream: Permission denied in /var/www/tribology/public_html/wire/core/FileLog.php on line 82 Error: Exception: Missing or non-readable template file: admin.php (in /var/www/tribology/public_html/wire/modules/PageRender.module line 517) #0 /var/www/tribology/public_html/wire/core/Wire.php(383): PageRender->___renderPage(Object(HookEvent)) #1 /var/www/tribology/public_html/wire/core/WireHooks.php(698): Wire->_callMethod('___renderPage', Array) #2 /var/www/tribology/public_html/wire/core/Wire.php(442): WireHooks->runHooks(Object(PageRender), 'renderPage', Array) #3 /var/www/tribology/public_html/wire/core/WireHooks.php(782): Wire->__call('renderPage', Array) #4 /var/www/tribology/public_html/wire/core/Wire.php(442): WireHooks->runHooks(Object(Page), 'render', Array) #5 /var/www/tribology/public_html/wire/modules/Process/ProcessPageView.module(205): Wire->__call('render', Array) #6 /var/www/tribology/public_html/wire/core/Wire.php(383): ProcessPageView->___execute(true) #7 /var/www/tribology/public_html/wire/core/WireHooks.php(698): Wire->_callMethod('___execute', Array) #8 /var/www/tribology/public_html/wire/ This error message was shown because: site is in debug mode. ($config->debug = true; => /site/config.php). Error has been logged.
-
I have been using MapMarker on a client site for long. Recently I updated the website to Processwire 2.7.2. While trying to add a page using a template with FieldTypeMapMarker I noticed the address box has vanished even though the default map shows. Underneath the map I can see "N/A". Any idea how to get back address box.