Posts by kdl

    HI Marc,


    Apologies, I have just noticed your reply.


    Unless I am mistaken (quite probably), but I thought Perch only ships with Redactor and Redactor 2. Did you purchase and install your own licence of Redactor 3.


    As it turns out, I managed to get it working in redactor. I then tried to get the limiter plugin working, but ended up being pulled onto a different job, so I haven't looked at this in a few days :-(

    Thanks Clive, this works perfectly !!!!


    Somehow, I just managed to get myself in a tizz with everything and looking at some of my previous efforts (and some of the content out there), it is close, but no cigar.


    Cannot thank you enough for this, wish I had found it 48hrs ago as I might have had a bit of sanity left !!

    Yes, doing some more testing, the first config file I posted (with just fontcolor), if I swap this out to say table, redactor does not show this plugin.


    Changing my test template from redactor to redactor2 <perch:content id="testredactor" type="textarea" label="Redactor" html editor="redactor"> does display the table button, but if I keep redactor2 and change the plugin back to fontcolor, it does not display it !


    As such, it seems that certain plugins work for redactor and some for redactor2 that is shipped with Perch. As such, am I now correct in thinking that I will need to purchase whatever the latest redactor is and instal it into my PErch set-up as another further item, or probably remove the plugins redactor and redactor2 and instal this purchased item.


    However, I thought that Perch v3 had the latest redactor within it ?


    Absolutely confused and it's a day of banging my head against the wall.

    Would really appreciate any feedback.


    Thanks,


    Andy

    Hi Hussein,


    I am still really struggling with this and for some reason none of this works for my application, or it gives me some odd behavior, i.e. I need to have both an instance of 'redactor' and 'redactor2' in the template. I've had different elements working, but nothing consistently, so I have built a quick test page to see if I can get to the bottom of what is happening.


    To start from the beginning, so I leave zero stones un-turned, I am using Perch v3.1.6.


    I have added define('PERCH_CUSTOM_EDITOR_CONFIGS', true); into my config file.


    Now the more I have looked at things, the more confused I am. Perch v3 ships with two versions of redactor in the plugins folder, namely redactor and redactor 2.


    There seems to be some chatter that the 'default' version of redactor that is now shipped with Perch v3 is redactor v3 or is this just nonsense ?


    In my template, I am currently calling a test textarea with: <perch:content id="testredactor" type="textarea" label="Redactor" html editor="redactor">


    Now, the first thing I want to get into my head is that, as I want to expand/reduce the functionality of different configs of redactor, is it best to use editor="redactor" or editor="redactor2".


    For example, in previous trials, I have managed to get the plugin 'counter' working for redactor, but it does not display if I change the editor to redactor2.


    Anyway, skipping ahead. After reading your blog (link you provided above), I have tried to get the following config.js file working. Again, for completeness, this file is sitting at the location /addons/plugins/editors/config.js


    and I have downloaded and added redactor plugins from: https://imperavi.com/redactor/plugins/ which are located at: /addons/plugins/editors/redactor-plugins/


    Using your code in the blog for the plugin fontcolor, I have a config.js file of:


    All fine so far.


    But, if I want to add another plugin, such as 'counter', I download the appropriate js file from imperavi and then I would write something like:


    Which is not working because I am pretty sure I have called the load function incorrectly.


    The thing is, if I look at the documentation and other posts wrt config files, they all seem to write things differently and I cannot get an understanding, or consistency on what is happening.


    Also, do some plugins not work with redactor or redactor2 ? As you an see, I am completely confused ! and any help would be greatly appreciated.


    I've spent hours going through different posts, different types of config and still cannot get any clarity on which redactor to use, to enable the plugins to work and how best to wrote the config file.


    Thanks,


    Andy

    Has anyone managed to get the counter plugin working for Redactor 2 ?


    It seems that I can load certain redactor plugins, but items such as 'counter' do not seem to display, just wondering if anyone had managed to get this working at all ?

    Yes, I should have made it clear that I was using the term administrator in a generic way for anyone having the ability to administer the CMS. What I have so far is a series of different roles, so that individual editors can sign in and only edit the page that particular role allows them.


    In some ways, my specific requirements for this particular project might be fairly unique, as the 'editors' will be from different companies, all administering individual areas of a 'communal' website.


    However, irrespective of this, what I have found in the past with multiple editors (from the same company) is that they soon get confused as to what they are allowed to edit, if they are presented with 30pages in a list. If they logged in and only viewed the individual page that they were allowed access to, this would remove any confusion.


    I just find it odd that Perch can segment a users role to a region, which is much more granular and further down the line than just allowing access to individual pages.

    Yes, you still see the 'core' pages in the solution, even if all the administrator is allowed to do is say edit a blog.


    Really just cannot get around that you cannot hide pages from administrators. Will have to go back and check my Runway installations but I think that this is the same across all Perch platforms.


    Shame, as it looks as if I will now have to look at another platform and I really didn't want to, given the time constraints of the project.


    Will look at somehow getting into the core and see if I can write something for user management.

    Thanks Rene.


    Unfortunately, that's not good for this application, it really needs to be the pages, i.e. different administrators can only see the single page they are allowed to edit.


    I might be able to get around this by setting up a single page inside a 'blog' installation and then just giving the administrator access to his blog, but I'm not sure if they will still see the core pages. I will need to look into it. Then, I would just have to implement a blog installation for each administrator, so that when they login, all they see is that particular blog installation.


    Such a pain that you cannot 'hide' pages from administrators, as it just leads to confusion as to what they can and cannot edit. Should just be able to login and only see the page or pages they have access too.

    Ok, so almost literally after I have posted this, I have figured out how I can set-up an individual role for each administrator and set the region permissions to only give access to this user.


    In other words, I am creating a new role, say 'Page 1 editor'. Then, selecting the page -> region, I can then go into 'Region Options' and select the permissions and only give this role permission to edit this page.


    I can then set up further roles (Page 2 Editor, Page 3 Editor.....) etc and repeat the process, making sure that page 1 only has the permission for Page 1 Editor, Page 2 only has permission for Page 2 Editor etc etc


    However, whilst this works pretty well, if I login as Page 1 Editor, I can still see ALL the pages, even though I am not allowed to edit them and ideally, I want this role to just see Page 1 only.


    Hope this makes sense.


    There must be a way to 'hide' the pages that contain regions I am not allowed to edit ?

    Hi,


    I have a situation where a client wishes to have multiple administrators look after individual pages. That is, each 'editor' would need to have the privileges of 'login in', 'edit page details' and the selection of what 'page' they are allowed to edit.


    As such, when they login, they can just see the page they have been granted access to edit.


    There doesn't seem to be any obvious way out of the box to accomplish this, unless I am missing something. I could have sworn there was the ability to assign an editor a single page, or page by page selection of items they can see/edit.


    In-case I am missing something obvious, the only other workarounds I am thinking of would be to somehow create a 'blog' with a unique name to hold a page for each administrator and as such, they could then be assigned to view that blog only. Not exactly pretty !


    Not sure how far I could extend the members app and perhaps turn the page into a 'profile', but the page they would be editing needs to have ability to upload files, add text and images etc, which from memory, the members / profile element is not great at, or rather, not designed for.


    Any suggestions very welcome, as potentially I will require around 20 editors, to control a unique page each and without seeing or being able to edit the others.


    Thanks,


    Andy


    FYI, I am using Perch 3.1.6

    Hi,


    I have the Blog app running and I am using perch_content_custom to not only return a list of blog entries, but also, I am using it to return entries designated as 'most popular' and 'most recent' in a sidebar.


    The issue is, as soon as implement pagination on the post.php page, the main perch_content_custom call, which returns the listing of blog entries and is first on the page updates fine, but all content in the subsequent calls is lost.


    Is there a way to retain the content with pagination.


    The main template (index.php) looks like:



    Now I realise that the pagination is set within the template 'blog_post_in_list.html' which would then only effect that main element:


    Code
    1. <perch:template path="pagination/default.html" rescope="parent">


    but then how do I either move pagination to within index.php as <perch:template> cannot be directly applied, or do I somehow have to try and include the sidebar content within my 'blog_post_in_list.html' which I cannot see how to do, to get the pagination working.


    That is, the bog posts are paginated, but the content in the sidebar (post_in_list_popular_comments.html and post_in_list_recent.html) are not.


    Any ideas welcome.


    Thanks,


    Andy

    Hi,


    I'm sure I am just overlooking something obvious here, but let's say I have a contact form and I want this to to be within certain templates, i.e. the form appears on the homepage and a specific contact page, how do I use the same form in different templates.


    If I add the usual content call:

    PHP
    1. <?php perch_content('Contact Form'); ?>

    on both templates, I can get the responses stored in the same place, but one of the instances shows the 'success' message and the other doesn't. This seems to be linked to the fact that the admin has generated two instances of the 'success' input area, which I am presuming are conflicting.


    I am sure it can be done.


    Using perch_layout doesn't work. but there must be a way of including the form, without generating a new instance of it.


    Not sure if I am explaining it very well. It's late and I'm tired ! :(


    I am sure the penny will drop soon.


    Any quick pointers would be appreciated.


    Thanks

    Yep, as expected (but thought I might be going mad and doubting myself), it is there, listed under Extensions:

    Quote

    Extensions: Core, bcmath, calendar, ctype, date, filter, hash, iconv, json, mcrypt, SPL, pcre, Reflection, session, standard, mysqlnd, tokenizer, zip, zlib, libxml, dom, PDO, bz2, SimpleXML, xml, wddx, xmlreader, xmlwriter, apache2handler, openssl, curl, fileinfo, gd, gettext, mbstring, exif, mysqli, pdo_mysql, pdo_sqlite, Phar, ftp, Zend OPcache

    There must be something failing the function, as, once it is in the !isset element as mentioned above, I just cannot see how it escapes the return -1; item, to then process further.


    Obviously it must work for some people as surely everybody would be on this forum complaining that the Perch Twitter App doesn't work ?


    Thanks for all your responses and a big thank you to your mention about adding /perch/addons/apps/perch_twitter/settings/ to the callback url. This should really be added to the documentation as I've had this issue for ages (never got past the setup and as such gave up on the Twitter App completely for a while).

    Would have done it again, but client is adamant about having Twitter feed on the site and why not, should be fairly simple. Might have to look at other widgets, but at least I've got the Perch App working now, just not an elegant solution, or, inline with Perch. Hate hacking code.

    Ok, so looking into things (and not sure why I am doubting myself but it's been a long frustrating road), it seems I am correct in the fact that JSON is complied in my PHP installation. Infact, I would have done pretty well (or be using a very old version) to have not had.


    I've looked at PerchTwitter.class.php (line 162 - 166), some more:


    Code
    1. if (!isset($item->error)) {
    2. return $item->html;
    3. }
    4. return -1;

    and have come to some form of conclusion. Firstly, I'm not 100% sure how, within the scheme of this file, the process ever gets past the return -1 item to process anything else in the file. Just doesn't quite makes sense to me.


    Removing the above code from the file does allow me to now return and display the tweets without error, just in raw html format.


    As such, changing the tweet.html template to:


    Code
    1. <perch:twitter id="tweetHTML" encode="false" />

    allows the tweets to be rendered in html.


    This now returns the latest 3 tweets, although the formatting is not what I expected, with no options for retweets, follow etc, but I guess I can build a custom template for this.

    Before anyone says it, I do not like editing CORE code, but this fix worked for me. It's not the answer, there is definitely something not quite right with the PerchTwitter.class.php script, but with client pressures and demands, I will try and take a look at this asap and see if I can figure it out, or what infact the offending lines of code are doing.


    Not sure if, when Perch 4 is delivered, a new Twitter App will also be updated, or it will work, but I really wanted to keep using the Twitter App, rather than looking at alternative solutions.


    I love Perch and it's frustrating but these things happen. Surely cannot be the only one who has encountered this problem and hopefully this workaround, albeit I'm sure, temporary will help a few people out.

    I'm running XAMPP Version: 7.0.4, but not sure if this ships as standard install with PHP JSON library or not.


    Is this something that should show up in the extended diagnostics from the Perch installation ?

    ergrge


    Yes, as suspected, I have tried all permutations and still the above line 163 error.


    That is, I have used:


    addons/apps/perch_twitter/settings/


    Your Twitter username (required): @KLSSupportUK and KLSSupportUK


    with:


    PHP
    1. <?php
    2.     perch_twitter_get_latest(array(
    3.         'twitter_id'=>'KLSSupportUK',
    4.         'type'=>'mine',
    5.         'count'=>3
    6.     ));
    7. ?>


    PHP
    1. <?php
    2. perch_twitter_get_latest(array(
    3. 'twitter_id'=>'@KLSSupportUK',
    4. 'type'=>'mine',
    5. 'count'=>3
    6. ));
    7. ?>


    PHP
    1. <?php
    2.     perch_twitter_get_latest();
    3.     perch_twitter_widget_js();
    4. ?>


    The only thing that starts to allow the displaying of the tweets is the removal of the code around stated line 163 in PerchTwitter.class.php.


    The setup is authorising, bringing down tweets with no error anymore (when code removed), so it must be something to do with:


    Code
    1. return $item->html;


    failing, as this, I presume is allowing the tweet to be rendered in html format.