Jump to content

ceberlin

Members
  • Posts

    533
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by ceberlin

  1. Found it. This did the trick:

    1. To start over, I deleted the HanaCodeHelper entry from the database directly (at "modules")

    2. Then I found the module after refreshing Modules in the Admin under the "install" tab and could install it normally

    (Is it because the Helper code has no uninstall code yet?)

    • Like 1
  2. Hi teppo,

    good news that it is working at your install. So there is hope :-)

    Your questions:

    I do not see js errors (only the [Error] TypeError: null is not an object (evaluating 'e.length') which comes from the very outdated jQuery, the PW core still uses.)

    i am on MAC Yosemite with Safari, Admin Theme is Default, PW ist latest DEV.

    I do NOT see the mentioned line of code in the template source.

    UPDATE:

    I was tricked by the ModuleManager. The Plugin was downloaded but actually never installed. Since there was no warning, I thought it installed.

    So I have the sort of installation problem reported here before  - and not a display problem, what I thought.

    I am on PHP 5.6.  / The Helper code does not use PDO database code yet. ...maybe that plays a role?

  3. I tried Hanna Code today for the first time and I am amazed how cool it is.

    I also tried the Helper. It installed without issues. But I can't see the new Icon appearing in CKE's contextual menu.

    Maybe this has to do with the many changes CKE at Processwire had since the release of this Helper module.

    Is there something I need to set in the CKE field settings? Like adding Plugin info manually?

  4. On one site (using the dev version of PW, I misconfigured the field settings somehow to close and return to the field-list after each save every time.

    My settings in the AfterSaveAction module are ignored in that case.

    I just cannot remember where that setting was, to revert it to the normal behavior.

    A global PW setting somewhere? A module? I really have no idea.

    Has anyone a hint for me?

  5. Hi Nico,

    >Canonical

    >Yes it's $page->httpUrl

    I see a potential double content problem here:

    A page can exist in http and in https mode. Especially after a https page was called (admin area, or a form in the frontend for example) a user stays in https mode until a next page which is set as http-only was opened.

    Do you agree that a double content issue is possible?

    If so, my idea would be using this checking order:

    1. is the whole site https only (the brand new setting option in the latest dev) ->https

    2. fallback: is there a strict setting in the URL part of the template for https? ->https

    3. fallback: use the common way to display a website ->http

    What Do you think?

  6. Hi Nico,

    it's about time for me trying your module. Fist of all: Thank you for sharing!

    I have a question about the title (or maybe a wish):

    The title can be pre-filled automatically. I like that. But it is limiting for me.

    Right now I have a separate field for the window title, called title_window.

    The reason:

    This gives me the freedom to name the page differently in the admin (for the page list and selections) and the real title output.

    The title is filled in by the editor and the title_window is left to set by the seo guy.

    In case the title_window (SEO) is not set, there is a fallback to the title, when I output the site.

    (I think that is the way Wordpress handles that too, in combination with the SEO module, if I recall this correctly.)

    (EDIT: Why an extra field and not the module: I do not like the tab clicking to the SEO area in the normal workflow of an editor.

    I want the editor to have the title and the SEO title close together. - But this is a matter of taste)

    Is there a way to mimic that in the module?

    Select a custom field with a fallback to title?

    (Of course there are workarounds for me - maybe this idea finds friends in the community But maybe this makes things too complicated. :-) )

    And some small thoughts:

    canonical

    I would like a comment to the canonical tag field what default you set in case the field is empty.

    (it is probably the page url without segments and variables?)

    segments and variable

    A question is how to handle segments and variables (page numbers) best?

    I use segments and page numbers for filtering content.

    To avoid double content I set my templates manually at the moment to set a noindex tag in case a segment or page number is found.

    I wonder if this is good practice/needed when there is a canonical tag.

    link rel="alternate" hreflang

    On my multi-language sites I have something like this:

    <link rel="alternate" hreflang="en" href="http://mysite.com/en/press/" />
    <link rel="alternate" hreflang="es" href="http://mysite.com/es/prensa/" />
    <link rel="alternate" hreflang="en-us" href="http://mysite.com/us/press/" />
    

    This links same content in different languages together for Google.

    Depending on how languages are set up on the site, the module could easily write such code automatically.

    (Right now I have some hand coded stuff which does exactly that...)

    EDITED

    • Like 1
  7. What I did was setting the path as a setting within my user-login template, using a page field (with the output set as single page). 

    So the admin/editor can choose where to redirect frontend users to. Nothing hard coded there.

  8. On installations and updates appears the well known warning whether to trust the source of a zip flle. A useful reminder.

    But there is only a "yes/no" modal. You do not see that link displayed anywhere (or only encoded in the browser's status bar, it that bar is set to "visible"). - I am always temped to click "yes" and simply ignore the warning. 

    I was thinking whether some more evaluation before a download would be useful to add some security:

    •  maybe at least showing that link in the modal dialog.
    • maybe having an active link to the corresponding GitHub/Bitbucket page - so you can open if and, on updates, quickly look through the changes there first
    • maybe give a louder warning if the target is not a zip file coming from GitHub/Bitbucket.
  9. Hi Netcaver,

    I double checked with my MYSQL software NAVICAT. I can confirm now that the problem of false errors is there.

    I found what those affected fields have in common:

    The module reports totally wrong MysQL overhead warnings of abt. 300 MB (always the same value for any of the fields in question by the way) for any field that has InnoDB set as engine (instead of MyISAM). This is even for freshly installed fields.

    In those cases also the "optimize" link has no effect.

    And for those other fields: a "WARNING" is very dramatic info if shown even for fields hat have something like 32 bytes overhead.

    Maybe there should be a threshold before a warning is fired. So WARNINGS are not used to excessively with the effect that that real important warnings are taken more seriously within the module. Do you agree?

  10. Hi netcarver,

    I start to getting errors with the module. I think this is because I use the latest PW (2.5.8) dev and something changed.

    Can't save page 1234: /processwire/access/users/test01/:

    Call $page->setOutputFormatting(false) before getting/setting values that will be modified and saved. [sla_fail_lastsent] 

  11. if( $user->hasRole('user')       &&
        !$user->hasRole('editor')    &&
        !$user->hasRole('admin')     &&
        !$user->hasRole('superadmin'))
    {
        //password reset stuff here
    }

    Thanks Macrura. That would work and that is how I had it. Problem is that this would break my security concept the minute I change a role or add one - and forget to update this code afterwards.

    Now you can check if a user has the role "user" and a total of 2 roles assigned. In PHP:

    if (count($user->roles) == 2 && $user->hasRole("user")) {

    //do stuff here

    }

    gebeer, this is so brilliant!  - exactly what I was looking for. And you come up with ideas like this at 3 in the morning? :)
  12. I have a tricky question with the roles.

    i have those roles

    -(guest)

    -user

    -editor

    -admin

    -superadmin

    For security reasons I want to allow the password reset only for people that are "users" but have no higher role. (An editor should ask the superadmin instead.)

    Is there an easy way to check whether a user has ONLY the role of "user", and nothing else?

  13. Hi,

    the module breaks the admin backend of the frontpage here (which has no name!), if "initiial differenes proteced" is on:

    This(?):

    $(document).ready(function() {

        initialTitleConverted = InputfieldPageName.sanitize($(".InputfieldPageTitle input[type=text]").val());
    });
     
    causes this error:
    ReferenceError: Can't find variable: InputfieldPageName
     
    The effect is that all javascript is not working.
  14. Update:

    rendering is so easy I could not believe it. The code worked for me (in case anyone has the same question):

    foreach ($page->my_pagetable as $block) {
    $block->render();
    }
    

    Now I could see for myself:  isset makes the NOTICE go away but the clever switch trick from Joss does not work either. :(

    EDIT:

    This switch seems to work for now:

    <?php if(strpos($_SERVER['REQUEST_URI'],wire('pages')->get(wire('config')->adminRootPageID)->url) !== false) : ?>
    

    Credits to Nico

  15. I also see that NOTICE. With using isset I got it go away. Not sure your switch still works with isset, I did not code the front end output yet.

    By the way: what is the recommended way to output the content? 

    I am really fallen in love with this extended module. I see the huge benefits. Very smart.

    I want to use ist that way - like in the example movie - that the pagetable elements render as inluded "blocks". Like the repeater field did it.

    masterpage

    - block

    - block

    Do you have a code example? I am curious how $page works in that context (does it refers to masterpage or block)...

    And how does the find work - does it find the masterpage if the searched for content is in a block?

    (Too bad that there is no full example/tutorial online yet - I found only fragments of explanations spread all over the forum.)

×
×
  • Create New...