Jump to content

kaz

Members
  • Posts

    225
  • Joined

  • Last visited

Everything posted by kaz

  1. if I do two installations: what do I do with the "root – selection-page"? With each installation the selection in page ID1? That would be an internal, and an external link to the second URL.
  2. @zoeck No, not necessarily. I have no experience with it. I also think (as you write) that is too much?
  3. I have a company that is divided into two parts. I'm thinking about how to set up the site. My present idea is: The landing page (ID 1) with a landing template / page which links to two sub-pages. Subpage 1 is Part 1 of the company, Subpage 2 is Part 2 of the company. Each part has a separate root page / template, with its own menu. I then have to align the menu to the template? Each part has its own URL, but I don't have a solution. I think I will simply redirect one of the URLs via 301. How would you setup this situation? A sketch for better understanding:
  4. Now it works. I had to think about what 'value' is. I take the ID, maybe it was the same lake the values, and it works. $w1=intval($item->colwidth->id) My Options are 1=1 2=2 3=3
  5. @DV-JF The value then is passed with NULL, when 1 is selected: w1 = uk-width-0-4@m w2 = uk-width-4-4@m
  6. sorry, I don't understand? w1 = $item->colwidth; the value is passed, $w2 = 4 - $w1; needs to change something on this line?
  7. @gebeer I have sadly an error message with the minus operator, the passing of w2: Notice: Object of class ProcessWire\SelectableOptionArray could not be converted to number in /Users/Sites/localhost/domain.com/site/templates/fields/matrix.php on line 26 Line 26 is $w2 = 4 - $w1; The operator is correct, the error is probably in the position of the lines? It's part within a repeater matrix, here's the full code: if($item->type == 'twocols_content') { $w1 = $item->colwidth; $w2 = 4 - $w1; echo "<article uk-grid> <div class='uk-width-{$w1}-4@m uk-width-1-1@s'> … </div> <div class='uk-width-{$w2}-4@m uk-width-1-1@s'> $item->content </div> </article>"; } w1 is passed correctly after selection, the Options/Select field colwidth is passed. I have applied it this way (InputfieldRadios): 1=1 2=2 3=3 4 I don't need, 4 results in zero, when the minus operator works 😉
  8. @gebeer I will try that, it looks easy. Thanks!
  9. I would like to give an editor the ability to specify the width of columns in a section. The template may have 2 columns, which have now the with of quarter spacing. How do I set it up to make the most sense? If the editor sets the left column to 4, the right column should automatically be 8. Is there a way to do such a setting. I have no idea which field is best suitable for this? I had a look at FieldtypeOptions, but I don't think that's right? maybe InputfieldFloatRange, but then I have only one width. Has anyone implemented something like this before and can give a tip? It would be great if the editor could change the widths uk-width-1-*@m. Here an example of how I do it statically at the moment. <div uk-grid> <div class='uk-width-1-4@m uk-width-1-1@s'> <figure> <img src='{$page->image->url}' alt=''> </figure> </div> <div class='uk-width-3-4@m uk-width-1-1@s'> $page->body </div> </div>
  10. Exactly, that was my goal, to do it in the base template. Thanks that works!
  11. @netcarver thanks netcarver, this helped a lot. echo "<ul id='side-menu' class='uk-list uk-margin-remove uk-padding-remove'>"; foreach($pages->get(1044)->children as $child) { $active = wire('page') == $child ? "current" : ""; echo "<li class='$active'><a href='$child->url' title='$child->title'>" . $child->get('menutext|title') . "</a></li>"; } echo "</ul>"; I call the list pages in my base template with the page ID of the parent page: <?php if ($page->id == 1044): ?> <?php include('views/partials/menu-aside.php'); ?> <?php endif; ?> However, the list should also be displayed in all children's pages. ID is therefore wrong? Is there another option which includes the children's sites?
  12. sorry, a typing error: mengtest = menutext ('menutext|title')
  13. I need to list subpages by mengtest and title of a mother page as a simple foreach ul list. Is there a way, similar to a menu, to list child pages? I couldn't find anything about this in the docs. Maybe you can give me a hint what to look for?
  14. kaz

    Site url?

    When I use echo $page->httpUrl; I get the config url's, for example: domain.com,www.domain.com, what is just included in the config How do I get only one complete root URL incl. https:// maybe for <base href="<?php echo $urls->…; ?>" />
  15. It doesn't work, probably it's just too much 'if' in too many files? The modal window is not displayed, but exists in the source code of the browser. It is hard to describe, why it does not show up. So I just leave the error message, because it works with these error, although not clean. I removed the space before .show(), it makes no difference. PS: It's hard to test, because the popup appears only once :) that's why my reply took so long.
  16. I load the UIkit scrips before UIkit.modal. Perhaps I'm misunderstanding something, have a look at the post from September 3. The error message appears only if the field settings_modalwindow has no entry. If the field has an entry, it works. That's why I thought it would be necessary to query both?
  17. I have a little error (code inspector) message due to the double if query: Uncaught TypeError: UIkit.modal(...) is undefined <anonymous> https://localhost:8890/:240 In the prepend / append files I have these code: prepend: <?php if ($global->settings_modalwindow): ?> <div id="modal-center" class="uk-flex-top" uk-modal> <?php echo $global->settings_modalwindow; ?> </div> <?php endif; ?> append: <?php if ($page->id == 1): ?> <script> let infoShown = localStorage.getItem('infoPopup'); if(!infoShown) { UIkit.modal('#modal-center') .show(); localStorage.setItem('infoPopup', 1); } </script> <?php endif; ?> The error message is generated by the code in the append file when the settings_modalwindow field has no content, but the code is still loaded. I would need to query both ID1 and whether the field has content. Is it possible to query both at once?
  18. @flydev ?? unfortunately it did not work edit: a typing error, I revise: it works! if ($page->hero_items->count):
  19. @bernhard Good idea, but: I have tested TracyDebugger, it is too complicated for me.
  20. I have a repeater field hero_items that I use for hero images. If no image is uploaded, an image field (settings_hero_image) from the global settings should be displayed. Unfortunately that does not work. The code for the data is correct. If the parts are single (hero_items or settings_hero_image) the images will be displayed. If no image is uploaded under hero_items, the browser code looks blank. Actually, else should now be displayed. If images are uploaded, the source code is correct. What is wrong with my if else query?
  21. @Andi I will try that, thanks! Addendum: works great with PHP > 8
  22. I' ve changed the PHP version localhost from 7.4.21 to 8.1.1. When I make a change in the editor (e.g. in pages), this error message comes up: Fatal error: Uncaught TypeError: round(): Argument #1 ($num) must be of type int|float, string given in site/modules/FieldtypeLeafletMapMarker/InputfieldLeafletMapMarker.module:193 #0 site/modules/FieldtypeLeafletMapMarker/InputfieldLeafletMapMarker.module (193): round('', 4) #1 wire/core/Wire.php (417): Processwire\InputfieldLeafletMapMarker->___processInput(Object(WireInputData)) #2 wire/core/WireHooks.php (951): Wire->_callMethod('___processInput', Array) #3 wire/core/Wire.php (485): WireHooks->runHooks(Object(Processwire\InputfieldLeafletMapMarker), 'processInput', Array) #4 wire/core/InputfieldWrapper.php (1137): Wire->__call('processInput', Array) #5 wire/core/Wire.php (417): InputfieldWrapper->___processInput(Object(WireInputData)) #6 wire/core/WireHooks.php (951): Wire->_callMethod('___processInput', Array) #7 wire/core/Wire.php (485): WireHooks->runHooks(Object(InputfieldFieldsetOpen), 'processInput', Array) #8 wire/core/InputfieldWrapper.php (1137): Wire->__call('processInput', Array) #9 wire/core/Wire.php (417): InputfieldWrapper->___processInput(Object(WireInputData)) #10 wire/core/WireHooks.php (951): Wire->_callMethod('___processInput', Array) #11 wire/core/Wire.php (485): WireHooks->runHooks(Object(InputfieldFieldsetOpen), 'processInput', Array) #12 wire/core/InputfieldWrapper.php (1137): Wire->__call('processInput', Array) #13 wire/core/Wire.php (417): InputfieldWrapper->___processInput(Object(WireInputData)) #14 wire/core/WireHooks.php (951): Wire->_callMethod('___processInput', Array) #15 wire/core/Wire.php (485): WireHooks->runHooks(Object(InputfieldWrapper), 'processInput', Array) #16 wire/core/InputfieldWrapper.php (1137): Wire->__call('processInput', Array) #17 wire/modules/Inputfield/InputfieldForm.module (189): InputfieldWrapper->___processInput(Object(WireInputData)) #18 wire/core/Wire.php (417): InputfieldForm->___processInput(Object(WireInputData)) #19 wire/core/WireHooks.php (951): Wire->_callMethod('___processInput', Array) #20 wire/core/Wire.php (485): WireHooks->runHooks(Object(InputfieldForm), 'processInput', Array) #21 wire/modules/Process/ProcessPageEdit/ProcessPageEdit.module (2203): Wire->__call('processInput', Array) #22 wire/core/Wire.php (417): ProcessPageEdit->___processInput(Object(InputfieldForm)) #23 wire/core/WireHooks.php (951): Wire->_callMethod('___processInput', Array) #24 wire/core/Wire.php (485): WireHooks->runHooks(Object(ProcessPageEdit), 'processInput', Array) #25 wire/modules/Process/ProcessPageEdit/ProcessPageEdit.module (2009): Wire->__call('processInput', Array) #26 wire/modules/Process/ProcessPageEdit/ProcessPageEdit.module (563): ProcessPageEdit->processSave() #27 wire/core/Wire.php (414): ProcessPageEdit->___execute() #28 wire/core/WireHooks.php (951): Wire->_callMethod('___execute', Array) #29 wire/core/Wire.php (485): WireHooks->runHooks(Object(ProcessPageEdit), 'execute', Array) #30 wire/core/ProcessController.php (337): Wire->__call('execute', Array) #31 wire/core/Wire.php (414): ProcessController->___execute() #32 wire/core/WireHooks.php (951): Wire->_callMethod('___execute', Array) #33 wire/core/Wire.php (485): WireHooks->runHooks(Object(ProcessController), 'execute', Array) #34 wire/core/admin.php (160): Wire->__call('execute', Array) #35 wire/modules/AdminTheme/AdminThemeUikit/controller.php (15): require('/Users/dylan/Si...') #36 site/templates/admin.php (15): require('/Users/dylan/Si...') #37 wire/core/TemplateFile.php (327): require('/Users/dylan/Si...') #38 wire/core/Wire.php (414): TemplateFile->___render() #39 wire/core/WireHooks.php (951): Wire->_callMethod('___render', Array) #40 wire/core/Wire.php (485): WireHooks->runHooks(Object(TemplateFile), 'render', Array) #41 wire/modules/PageRender.module (575): Wire->__call('render', Array) #42 wire/core/Wire.php (417): PageRender->___renderPage(Object(HookEvent)) #43 wire/core/WireHooks.php (951): Wire->_callMethod('___renderPage', Array) #44 wire/core/Wire.php (485): WireHooks->runHooks(Object(PageRender), 'renderPage', Array) #45 wire/core/WireHooks.php (1059): Wire->__call('renderPage', Array) #46 wire/core/Wire.php (485): WireHooks->runHooks(Object(Page), 'render', Array) #47 wire/modules/Process/ProcessPageView.module (184): Wire->__call('render', Array) #48 wire/modules/Process/ProcessPageView.module (114): ProcessPageView->renderPage(Object(Page), Object(PagesRequest)) #49 wire/core/Wire.php (417): ProcessPageView->___execute(true) #50 wire/core/WireHooks.php (951): Wire->_callMethod('___execute', Array) #51 wire/core/Wire.php (485): WireHooks->runHooks(Object(ProcessPageView), 'execute', Array) #52 index.php (55): Wire->__call('execute', Array) #53 {main} thrown (Line 193 in site/modules/FieldtypeLeafletMapMarker/InputfieldLeafletMapMarker.module) I set back the PHP to 7.4.21, now I don't have an error. Just for information for the developer, PHP 8 is causing problems, at least for me. Maybe it's only me?
  23. if we know "how"; thanks for your support!
  24. Sorry for the confusion. Both are loaded above the closing body, in that order: UIkit.modal('#modal-center') .show(); script src="<?=urls()-> I just wanted to point out that both are above the closing /body. The <div id="modal-center" class="uk-flex-top" … is directly below the body tag. That was bad planning on my part. Of course I can only call a function when the script containing the function has been loaded before. I have now solved it this way: <script src="<?=urls()->templates?>assets/uikit/js/uikit.min.js"></script> <script src="<?=urls()->templates?>assets/uikit/js/uikit-icons.min.js"></script> <?php if ($page->id == 1 ): ?> <script> UIkit.modal('#modal-center') .show(); </script> <?php endif; ?> That works fine. I have defined a query for Home, because the window may only be called up one time when loading the website. It will be an information window with medical advice. It would be great if it were only displayed once, but that is probably not possible with the UIKit function. I didn't understand your explanation with ready.php, would the procedure make more sense? Or is document.ready callback different from the ready.php ?
  25. Hi @bernhard, I load the scripts <script src="/site/templates/assets/uikit/js/uikit.min.js"></script> <script src="/site/templates/assets/uikit/js/uikit-icons.min.js"></script> </body> If I open the source code via Cmd + Option + U, the link is accessible, these scripts are loaded. I hope these are all the scripts I need for this function?
×
×
  • Create New...