Jump to content

felic

Members
  • Posts

    31
  • Joined

  • Last visited

Posts posted by felic

  1. 5 hours ago, bernhard said:

    For me: No, sorry. I don't get it or maybe I'm misunderstanding it.

    Looking on my yesterdays post with a fresh eye,- how one could possibly understand what i was talking about... Sorry.

    No, i don't to add CSS/Markup on the fly to the frontend. Hopefully it becomes more clear if i'll be more descriptive ...

    When i build client pages and it's specified what content elements the page needs, i begin writing the Markup/CSS (Plain HTML). This contains different kinds of content elements or/and content element groups which building a meaningful unit. Some call it Modules, some call it Components, some even don't have a name for it...

    Examples (for Modules as i like to call them for now):

    - Some Text with a Heading and Picture aside
    - Picture Gallery with Captions
    - List of employees (Picture, Contacts)
    - <you name it>

    When i am done with writing the markup/css i integrate this into the CMS: create appropriate fields, assign them to templates, populate the template files with the variables a.s.o.

    The order and what is displayed on page edit screen is determined. Optional i can create fieldsets to group depending fields (representing the internal module) visually a bit. But that's it...

    So, i was wondering if i can find a way that gives me (and the clients later on) a bit more flexibility on adding/reordering predefined content elements (e.g. Modules). 

     

    Use case:

    I am on a edit screen of some page (backend). Some kind of selection allows me to pick a available module (which represent a bunch of fields) to add to the page. For example the module "List of employees" (s. above). After that i select another available module (e.g. "Picture Gallery") and add it.

    So the page looks like this:

    <List of employees>
    <Picture Gallery>

    Next i like (drag&drop) to reorder the former added modules (to make sense,- this should reflect the display in the frontend of course. But that is not important for this use case) . 

    So afterwards the page looks like this:

    <Picture Gallery>
    <List of employees>

    Now i like to add another instance of the "List of employees" Module because there some more company divisions.

    <Picture Gallery>
    <List of employees>
    <List of employees2>

    Because the Division Boss is a VIP (so he thinks at least), i move the last "List of employees" to the top of page. 

    <List of employees2>
    <Picture Gallery>
    <List of employees>

     

    Hopefully this makes it more clear what i meant...

    Maybe i am missed something that exist (forum post or in the processwire modules section) yet. 

    regards
    felic

     

  2. Hi,

    sorry, the title is a bit hazy i am afraid...

    I rather have some knowledge in building a proper CSS/HTML Structure for the sites i build. To keep it simple,- i build CSS-Modules in conjunction with the proper Markup. In the processwire context this means, those CSS-Modules are represented through defined groups of (processwire)fields.

    What i like to achieve: Make it possible to add various, different Modules on the fly while in page edit mode. And, thats important, make it possible to change there position by drag&drop (reflects the order within the frontend).

    As a first approach i though using Repeaters could fit. But all my attempts leads to a dead end in one way or another.

    Reading a lot about PageTables, Page References and the like to see if this would be a good approach leaves me a bit stumped.

    Maybe one you guys can give me a boot on this... Any suggestions? ?

    I hope my description what i like to achieve is precise enough.

    Thanks in advance, regards

    felic

  3. Hi,

    sorry, hope this isn't PW off-topic,- actually i am not sure yet.

    One Domain with PW installed (latest 2.7) performs only with a very, very slow response. So i wrote a mail to the Hoster-Support because i haven't a clue what causes this behavior.

    Their answer was: "The script calls a IP per SSL, which response is heavily delayed. The IP has no Reverse-DNS Entry. [*IP adress*]".

    "Script" means PW, i suppose. But still i have no idea how to solve this. I tried to exclude the IP address within the htaccess. No luck. I temporarily pulled out the installed modules (deleting the directories per FTP, as i don't get into the admin because of a timeout). No Luck. I am running out of ideas...

    Any hint how to solve this or for further investigation are highly appreciated! ;-)

    Thanks and greets  

  4. Hi,

    i am using this Module for quit a while with great joy. Easy to implement and very flexible.

    Right now i wonder if something like this is possible by using just the module options without hooking the core: I have a 2-level menu with several parents and relevant child pages. On last parent the child array is (should) populated from a variable ($items), which collects only (child) pages with dedicated page view permission.

    So i fiddle around with the "selector_levelN" option. First try:

    $options = array(
      "levels" => true,
      "max_levels" => 2,
      "selector_level2" => "id=$items"
    );
    

    This gives me the expected result in level2 on the last child tree, but fails of course because the selector ("id="$items") returns nothing on all other parent/child levels. What i would need is some condition like (Tried this and other notations, no luck):

    $options = array(
    ...
    "selector_level2" => (parent=<id>) ? "id=$items" : ""
    );

    In words. If the parent page has a dedicated ID (here: the parent page which holds all permission controlled (child) pages), populate the "selector_level2" option with predefined pages ($items), otherwise don't constrain the collecting for level 2.

    Probably this is the nutshell: Are condition possible/allowed in module option selector values?

    cheers and thanks

    felic

  5. Hi everyone!

    I have parent page (and template) dates with numerous child pages for single event dates. Beside the content related fields each child page contains two fields which are added (for now) just for sorting purposes (item_sorting_monthitem_sorting_year). Getting those child pages and output them in a straight foreach loop is simple:

    $current_date = date("d.m.Y");
    $items = $page->children("item_date>=$current_date, sort=item_sorting_year, sort=item_sorting_month");
    
    foreach($items as $item) { .. }

    This gives me a well sorted flat output like this:

    - item

    - item

    But what i like to achieve (and doesn't get it right) is this:

    - Year

    -- Month

    --- item

    -- Month

    --- item

    - Year

    -- Month

    --- item

    -- Month

    --- item

    Additionally i like to establish a anchor link navigation to all available month, e.g. Feb.2016, Jul.2016, Jan.2017 a.s.o. because the list might be a large one.

    I spent more than a day with several trail/error (separate $page->find(...), nested foreach loops etc.) at least. But all leads to nothing :-/

    Maybe some of you have some hints where to look at, e.g. how to achieve this. I hope my description is precise enough. Otherwise, please don't hesitate to ask.

    Cheers and thx in advance

  6. Hi,

    i installed the core module "Comments" (with all its dependencies) several weeks ago while PW was still on 2.6.x. Meanwhile i've updated PW to 2.7.1. Now i want to uninstall/remove that module. Which fails with a "class not found" error.

    Error: Class 'Comment' not found (line 80 of /xxx/wire/modules/Process/ProcessCommentsManager/ProcessCommentsManager.module) 
    // ProcessCommentsModule.module, line 80
    public function init() {
    parent::init();
      $this->statuses = array(
        Comment::statusApproved => $this->_('approved'),
        ...
      ); 
    }
    

    As this is a core module it is certainly not a good idea trying to remove this by hand. So, can anybody give some advice what to do to get this module in a "uninstalled" mode again?

    Thx in advance.

  7. Ah, that's it. Got to remove some... Thanks to both of you, @justb3a, @BitPoet!

    mysql> select @@GLOBAL.sql_mode;
    +-----------------------------------------------------------------------------------------+
    | @@GLOBAL.sql_mode                                                                         
    +-----------------------------------------------------------------------------------------+
    | ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY
    | _ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
    +-----------------------------------------------------------------------------------------+
    
  8. +-------------------+------------------+------+-----+---------------------+----------------+
    | Field             | Type             | Null | Key | Default             | Extra          |
    +-------------------+------------------+------+-----+---------------------+----------------+
    | created           | timestamp        | NO   | MUL | 0000-00-00 00:00:00 |                |
    +-------------------+------------------+------+-----+---------------------+----------------+
    

    literally the same. Hm...

  9. Hi,

    since i updated my local mysql to v5.7.9, the Processwire SystemUpdater fails (on all local PW installations) with the following message:

    SystemUpdater: ERROR: Update #12 ERROR: SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'created'
    

    I suppose PW is not prepared for this mysql version.

    Sources: https://dev.mysql.com/doc/refman/5.7/en/upgrading-from-previous-series.html#upgrade-system-table-changeshttps://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_sql_mode

    As my database knowledge is limited,- can someone confirm this? 

    regards

    Olaf

  10. Hi,

    I am a bit surprised seeing a script works while on localhost, but triggers following error after shoving it to the online server.

    Logged Error while on the online server:

    Compile Error: Can't use method return value in write context
    

    The line in the script which triggers the error:

    if (empty($session->get("uploaded_documents"))) {... }

    So the getter session method causes the trouble here obviously.

    But since this all works flawlessly in my local dev environment, i currently have no idea, why this work only locally. Both PW installations, local and on the online are identical (PW 2.7.0.).

    A bit of context: I have a API Form which allows multiple file uploads. To prevent uploading each file over and over in case of a validation form error i set sessions to temp save the paths of uploaded files until the form validates. So the condition above lives within following structure:

    // form was submitted so we process the form
    if($input->post->submit) {
    
       // user submitted the form, process it and check for errors
       $form->processInput($input->post); 
    
      if (empty($session->get("uploaded_documents"))) {
        // doing some things/condition if or not to init the session and fill it with files arrays a.s.o.
      }
    
      if($form->getErrors()) { 
        // form contains errors...
      } else {
        // form validates, doing something...
      }
    } 

    What bothers me, is why it works locally but not on the online server?

    Any ideas are much appreciated!

    greets

  11. Hi,

    i have a specific question while dealing with file uploads: I have a (API) form which contains several file upload fields beside other field types elements. Some of them are required, so submitting the form gets into the error fork, when they are not populated/checked.

    A rather simplified structure of the form is available as a Gist (https://gist.github.com/e838fc5ecf90c309842e).

    The form (and uploads in general) works just fine, but i don't get along with the common issue, that all file uploads gets lost/empty if the form runs into the error fork after first submission, e.g. some required fields are not populated or checked (checkboxes). If the user correct this and submits the form again, no files are available any longer (without uploading them again on every submit. What is annoying and expresses rather lame UX).

    So i wonder how and where to store those file uploads temporarily, so they are available on form submission even if there are several submits because of form validation errors until the form succeed.

    My last approach was to put the generation of file uploads (e.g. building a array of all upload field values) shortly after the submit condition. But that doesn't work either, e.g. when submitting the form twice or more the $uploaded_documents array is empty...

    Perhaps some of you has a clearer view on that (?). Would be great.

  12. Hi,

    while trying to solve image upload problems (https://processwire.com/talk/topic/7749-max-image-dimensions-not-a-recognized-image-bug/) i had a look at the php error.log. There are several rather similar warnings there i understand (s. http://php.net/manual/en/security.intro.php) but not sure to evaluate them in conjunction with PW.

    Something like:

    [Mon Sep 14 13:34:14 2015] [warn] [client 79.193.219.101] mod_fcgid: stderr:  in Unknown on line 0, referer: [xxx]
    [Mon Sep 14 14:19:47 2015] [warn] [client 79.205.24.246] mod_fcgid: stderr: PHP Warning:  Adding option (Name: 'magic_quotes_gpc' Value: '0') (16, 1) failed!
    [Mon Sep 14 14:19:47 2015] [warn] [client 79.205.24.246] mod_fcgid: stderr: PHP Warning:  Adding option (Name: 'magic_quotes_sybase' Value: '0') (19, 1) failed!
    [Mon Sep 14 14:19:47 2015] [warn] [client 79.205.24.246] mod_fcgid: stderr: PHP Warning:  Adding option (Name: 'register_globals' Value: '0') (16, 1) failed!
    

    Setup: PHP 5.4.45-0+deb7u130, mysql 5.5.44-0+deb7u1-log, PW 2.6.1stable

    I do not experience misbehavior so far while using PW (except this image upload one), but i am curious if this could lead to any problems soon.

    Thx.

  13. Similar problem here.

    Refering to https://processwire.com/talk/topic/8712-imagefile-upload-problems-without-errors/?p=92979

    Changing the PHP ini file does not make any difference i am afraid. 

    PW V. 2.6.1 stable, any settings/permissions are identical to former installation (PW V. 2.6.0), no modules/plugins, Image Fieldtype, Debug mode is active.

    Wether drag/drop or select from input leads to:

    post-2270-0-48904200-1441567628_thumb.pn

    Header Response within chrome dev tools:

    post-2270-0-98404100-1441567625_thumb.pn

    After saving the page following message appear:

    post-2270-0-30631200-1441567976_thumb.pn

    It seems to me, there might a bug in the js ajax code(?).

    Anyone have any hints how to solve this? Would be great ;-)

    Thx in advance. 

  14. Hi tpr,

    I guess you simply forgot the context:

    <?php echo _t('Soziale Netzwerke', 'Footer');?>
    

    If you set no context, the default will be used ('Generic' in your example). So if you wouldn't like to write the context in your php files, you should add strings to the Generic context in your _strings.php:

    Thank you very much for your answer. I assumed to overlooked something. And here we go, the context was missing. All is doing fine now. Thx!

×
×
  • Create New...