Jump to content

ttttim

Members
  • Posts

    52
  • Joined

  • Last visited

Posts posted by ttttim

  1. When using the autocomplete field i get a JS 403 error You do not have permission to access this document.

    Anyone else got this error? 

    UPDATE

    When checking the hosting i get the following warnings COMODO WAF: URL Encoding Abuse Attack Attempt / Invalid URL Encoding: Non-hexadecimal digits used at REQUEST_URI

    SOLVED!

    The problem was caused by using %= as search operator when switching to *= it worked again.

     

  2. I love the module! 

    I was wondering how do you handle creating a page reference field when the templates and pages are created in the same migration. Because you don't know the id's yet.

    'fields' => [
    	'pageSelect' => [
    		'type' => 'page',
            'template_id' => XX, //template ID (foo-template to be created)
            'parent_id' => XX // Parent ID (parent-foo to be created),
            'inputfield' => 'InputfieldAsmSelect',
     	],
     ],
    
    'templates' => [
        'foo-template',
    	'parent-foo-template',
     ],

     

    • Like 1
  3. Hi i've recently changed a bulk of pages using the API for name-id to name-lastname. Only to notice that all the old URL don't work anymore even though the module was installed. 

    Is there a way to add to loop through the pages and set a custom redirect through the API? something like below (of course not a correct code)?

    foreach($team as $team_member){
    	$team_member->redirect($team_member-name.'-'.$team-member->id);
    }

     

  4. In your JS you're adding/removing the class w3-show but in your CSS your class is .show. Does your .column has

    display:none 

    This is used to hide all elements and only show the elements containing .show. Also make sure your .show class is beneath your .column class to override the display setting

  5. Hi @BillH

    Thanks for your reply. In the post you've mentioned the time is not relevant where in my case the date isn't relevant just the time. I believe that in php time is always connected to a date that's why i'm not sure how to use the selector just for time. 

    My alternative is to create an extra field in the back-end which will hold a string like '930' for 9:30 etc. But this seems like an ugly work around. 

  6. I'm building a filter system for courses where users can select a start and end time and I want to get all the courses within the selected time window. In the backend I have two datetime fields that holds the time. The filtered time is a string like '11:15'. To what do I convert the string to be used in a selector:

    start_time>=$startTimeString, start_time<=$endTimeString, end_time>=$startTimeString, end_time<=$endTimeString

    And do I need to set the Time Output Format?

  7. I'm using a Select Option field for a user to select a color by name. In the back-end the radio buttons are showing the title of the color but the actual value (the Hex) can't be traced using the Inspector. Is there a way to hook into the Radio input field to add the Hex value if one is selected? I'd like to add the selected color to the background of the field after save.

  8. I was recently experimenting with optimizing my images to get better load results. The code below is an example of what i've been using. It works nicely but the main problem is if i load a page for the first time after having added a few images my server will overload and return a 503 error. I have to refresh the page a few times for the server to resize all the images. Not a big problem while developing but not something I want on my live website. 

    <picture>
    	<source media='(max-width: 320px)' srcset='{$image->width(320)->url} 1x, {$image->width(640)->url} 2x'>
    	<source media='(max-width: 375px)' srcset='{$image->width(375)->url} 1x, {$image->width(750)->url} 2x'>
    	<source media='(max-width: 767px)' srcset='{$image->width(750)->url} 1x, {$image->width(1500)->url} 2x'>
    	<source media='(max-width: 1023px)' srcset='{$image->width(300)->url} 1x, {$image->width(600)->url} 2x'>
    	<source media='(max-width: 1319px)' srcset='{$image->width(450)->url} 1x, {$image->width(900)->url} 2x'>
    	<source media='(min-width: 1320px)' srcset='{$image->width(510)->url} 1x, {$image->width(1020)->url} 2x'>
    	<img src='{$image->width(1056)->url}' alt='$image->description'>
    </picture>";

    Is there a way to create these different sizes without overloading my server? 

    Ideally i'd like to expand the above code with webp support and a service like tinyPNG to reduce image size even further, but that would stretch the first load time even further. 

  9. Someone recently pointed to me that I wasn't using http strict transport security header. From what I've read it forces a connection to https instead of http. Is there a different compared to the use of the default method from the ProcessWire .htaccess?

    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

     

  10. I'm building an upload form for user to add images to a page. I would like for the user to change the image order after they add the images. Basically how the image field in the backend works. So users can drag and drop the image order. 

    The problem is that I don't know how to rearrange the data of my image field based on the order a user submits?

     

  11. I have an event page were you can select multiple sub-categories with a page field using checkboxes. Now i want to display all the sub-categories but also have them sorted by their parent category. I tried something lik below but that didn't work.

    $tags = $event_cat->find("sort=$event_cat->parent");
    foreach ($tags as $tag){
    	echo $tag;
    }

    Any ideas?

×
×
  • Create New...