Jump to content

ngrmm

Members
  • Posts

    421
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by ngrmm

  1. This is strange.

    Are those category pages actual pages in the frontend? Or are they just helper page to store data and they do not exist as pages in the frontend?
    You could reset the module cache to make sure, it's not cache related.

    Do those pages/templates have any special settings? Any non defaults? content-type? url segments?

  2. @protro I'm not familiar with rockfrontend. As you can see in a browser console your final code loads several files (uikit.min.js, uikit-icons.min.js, main.js, main.css) before loading your oswald.css file with the @font-face rules. The browser reads your oswald.css file and then sends a request to download webfonts.

    So two things delay the webfont download. The order of your js and css files and also the chaining via the font-face rule inside a css file.
    Most of the time it helps just to change the order and to set the css file at the first place.
    And as I said before the fastest way would be to inline those @font-face rules.

    If inlining does not help also, you could also give the browser a hint to preload webfonts like this:

     <link rel="preload" href="/site/templates/styles/whereever_your_fonts_are/webfont.woff2" as="font" type="font/woff2">
    
    <!--
    	
    	or for crossorigin
    	
    	<link rel="preload" href="https://www.domain.com/webfont.woff2" as="font" type="font/woff2" crossorigin>
    	
    -->
    • Like 1
  3. @cpx3 you could select the html5 native date field as your type and choos today as your default value.
    Your minimum values can be set via a hook

    $wire->addHookBefore('FormBuilderProcessor::renderReady', function($event) {
    
    	$form = $event->arguments(0);
    	if($form->name != 'your-form-name') return;
    
    	$inputfield_1 = $form->getChildByName('your_date_field_1');
    	$inputfield_2 = $form->getChildByName('your_date_field_2');
    
    	if($inputfield_1) $inputfield_1->attr('min', date('Y-m-d'));
    	if($inputfield_2) $inputfield_2->attr('min', date('Y-m-d', strtotime(' +1 day')));
    
    });


     

  4. Actually I prefer custom sizes or labels instead of numeric sizes. It far more intuitive to have small/medium/large instead of 3/12, 4/12 or 6/12 for users.
    In one of my projects I used numbers in combination with ion range slider (see screenshot). I don't like it anymore!

    After that almost all of the projects I tried to avoid column layout options via backend. Just here and there a „smaller“ or “bigger“ checkbox.


     

    Bildschirmfoto 2024-03-22 um 22.06.05.png

    • Like 1
  5. @kaz you could store your class in a variable before echo
     

    // storing class in a variable
    $class = ($page->check == 1) ? "checkedClass" : "defaultClass";
    //
    // or emtpy by default
    // $class = ($page->check == 1) ) "checkedClass" : "";
    
    echo "<img class='$class' src='{$page->image->url}'>";

     

    • Like 1
  6. @biberI don't get what you are doing with the $seg1 variable.
    What are you trying to access with $images->$seg1 ?

    And I doubt that the pageimage/s Classes have a get method that accepts two fieldnames.

    Let's say you want the value of the description field from your third image. You could access it this way:

    $images = $page->images;
    echo $images->eq(2)->description;



     



     

  7. I'm not sure where $images or $seg is defined in your code.
    Anyway, you can access images with key inside loops like this:

    foreach ($page->images->getValues() as $i => $image) {
    	echo "<img class='number_$i' src='$image->url'>";
    }
    
    // $page->images is an object
    // $page->images->getValues() is an array

    You can also access an image without looping

    $firstImage = $page->images->eq(0); // first image
    $thirdImage = $page->images->eq(2); // third image

     

    If name_1 isn't an extra image field, then you should access it via $page->name_1. 
     

  8. @joe_gi would recommend to let user add and sort pages manually. And add an extra checkbox or option/page field in which sorting options are available.
    Then you would use a hook to sort them by the option used after save.
    Your option field should have an empty option as default and should be resetted after save.

    I'm sure there are also ways to do that via JS in the backend.

×
×
  • Create New...