Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by hollyvalero

  1. Well, that explains it. I had ready.php in the templates folder, not up a level in the /site/ folder. I figured it had to be something stupid and I was right 😂 At least now I can get into hooks more... thank you!
  2. Making my semi-monthly attempt to get into hooks 🤪 I tried adding Ryan's renderLinks to ready.php at one of my sites... and then tried various versions of the usage, like: echo $pages->find("parent=/")->renderLinks(); in the templates. I take it as a sign of progress that I am past the 500 server error, but the output I get is the single word "array" this is not urgent of course, but wondering if someone can point me in the right direction?
  3. First of all, thank you so much for taking the time to slog through the set up - and all the screen snaps. I switched the url redirect "/login/" to the page ID to see if that might help, but I think what I did wrong was that --> on the login page template, the editor role could view and EDIT<--. Not just view. All the rest looked the same as far as the set up. I agree that it's a better practice to create a new role instead of just using login-register. Those changes seem to have fixed it... and the redirect($goto) is working too. I assume maybe the login template can be only view access. Let me just add that bit of wisdom to my "when the bad thing happened" file. 🙂 THANK YOU so much!! In the meantime I looked at Login Register Pro ... hopefully can offer either. h
  4. 1. using LoginRegister for a simple username/password to view a demo course. Vanilla installation: $modules->get('LoginRegister')->execute() Login url is /login/ using login template that anyone can see -> and that's working. when not logged in, you see the form. When logged in you see a logout link and copy that shows up upon logging in. -> that's working 2. There is 1 template: demos (for the actual videos) - viewable for login-register role, but not for guest. I have set the template to redirect to: /login/ if you are not logged in. when I go to the demo URL not logged in, I am bumped to /login/ -> that's working. http://test2.hollycodes.net/shop/view-demo-training-videos/security-awareness-for-it-professionals-demo/ 3. the guest role can page-view all except demos and login-register role can see all pages 4. When logged in as super user, I see all pages correctly 5. HOWEVER If I go here: http://test2.hollycodes.net/shop/view-demo-training-videos/ and follow the link to login: http://test2.hollycodes.net/login/ and enter frank daypass123 I get Welcome frank...and the welcome copy and a link to go to the courses... But when I click that course link to the demos template, it bounces me back to the login page, despite being logged in. ----> What am I doing wrong? <------ a. I was originally going to use login/register pro, but it seemed like overkill for a simple u/p combo... b. Then I tried to automatically bounce people back to the course list after logging in: <?php if($user->isLoggedin() && !$input->get('profile') && !$input->get('logout')) { $session->redirect('/shop/view-demo-training-videos/'); } else { // let the LoginRegister module have control echo $modules->get('LoginRegister')->execute(); } but the login just cycled between /shop/view-demo-training-videos/ and /login/ and melted down. Which seems like I should change it in the template, but that just makes no sense... ----> What am I doing wrong? <------ I uninstalled login/register pro, there's nothing in the error logs... tried it in a fresh browser - same issues What dumb thing am I missing here?
  5. Ha ha! Thank you for all your help. I did use Tracy Debugger when I first started and I wasn't skilled enough for it to be helpful... I will try that again! Good idea!
  6. THAT'S very cool. Just need to figure out what the "d" in d($products) means.
  7. I had something like this but it wasn't working... $products = $pages->find("template=product, limit=9, sort=sort" ); if($products > 3) { }
  8. I'm trying to come up with an automatic feature for a home page that will display 3 products (or more) in a slider carousel as long as there is a minimum of 3 items that qualify If there are less than 3, they would just not show up. I've been trying to add a count and this is working but it seems, at best, inelegant... $total = $pages->count("template=product"); if($total > 3) { $products = $pages->find("template=product, limit=9, sort=sort" ); } Is there a better/shorter way to put this?
  9. I haven't used the switch statement yet, but I'm looking into it... this morning I re-uploaded the code and this time, it worked... and I'm getting that first, second-third, rest view I was hoping for! Thank you so much for your input!!
  10. Hi! I'm working on formatting blog results. Currently I do a check for the first record and give it a bigger treatment, with a basic thumbnail/blurb/link for the rest... $items = $pages->find("template=articleblog|post, limit=30, sort=-cbdate"); foreach ($items as $item) { if ($item == $items->first()) { [ this is where we do the larger photo, blurb, etc. since it's the newest] } else { [ standard thumb/blub/treatment] } I'd like to be able to extend this so that the newest record got the big treatment, and then, say the next 2-3 got something bigger than a blurb, followed by the older treatment. I've seen the counter for first/last $i = 0; $length = count($items); foreach ($items as $item) { if ($i == 0) { // first } else if ($i == $length - 1) { // last } $i++; } But my attempts to figure out how to do this and increment the counter are resulting in server errors... $i = 0; $length = count($items); foreach ($items as $item) { if ($i == 0) { // first } else if ($i == 1) { // second } else if ($i == 2) { // third } else { // all the rest } $i++; } Looking for a good tutorial or idea for figuring out how to increment the counter and compare the number to choose the formatting for those array items that are not first or last. thanks in advance!
  11. *** Thank you. The more I played with it the more I thought, "you know... this is for search results...I don't think this is the right application for the pager... so I went on to do the next and previous page thing - less terrific than yours so I will be happy to try your code as mine is a little thin. But thank you for that. Suspicions confirmed. 🙂
  12. Oh, sorry... I took off the protected mode. It's open. Top level is cover, TOC is TOC Pages are report pages - with the pagination...
  13. Trying to create a report environment for a nonprofit with a lot of lengthy guides. 3 Templates: report cover, report TOC, report pages. Cover will be simple http://test.hollycodes.com/a-short-history-of-flatbreads/ TOC is a list in manual order of all pages http://test.hollycodes.com/a-short-history-of-flatbreads/table-of-contents/ Report page is the actual report content. These are the pages where I want pagination at the bottom in some format: Previous 1 2 3 4 5 Next Page numbers are turned on for the Report page template (not TOC or Cover - do they need to be on for the parent pages?) I am trying this for pagination: - - - - - - - $options = array( 'numPageLinks' => 10, 'listClass' => 'uk-pagination', 'linkMarkup' => "<a href='{url}'>{out}</a>", 'currentItemClass' => 'uk-active uk-text-bold', 'separatorItemLabel' => '<span>…</span>', 'separatorItemClass' => 'uk-disabled', 'currentLinkMarkup' => '<span>{out}</span>', 'nextItemLabel' => 'Next', 'previousItemLabel' => 'Previous', 'nextItemClass' => '', 'previousItemClass' => '', 'lastItemClass' => '', ); $items = $page->parent->children("limit=2"); $pager = $modules->get('MarkupPagerNav'); echo $pager->render($items, $options); - - - - - - - This is giving me the active page bold, the numbers, next & previous... but all the links are relative to the current page - whichever one you are on: http://test.hollycodes.com/a-short-history-of-flatbreads/table-of-contents/neanderthal-flatbreads/page2/ http://test.hollycodes.com/a-short-history-of-flatbreads/table-of-contents/neanderthal-flatbreads/page3/ Instead of going to the actual pages http://test.hollycodes.com/a-short-history-of-flatbreads/table-of-contents/neanderthal-flatbreads/ http://test.hollycodes.com/a-short-history-of-flatbreads/table-of-contents/indian-subcontinent/ http://test.hollycodes.com/a-short-history-of-flatbreads/table-of-contents/what-makes-flatbread-flat/ Been trying to suss out what I am doing wrong for a few hours and not seeing it...
  14. -- Thanks again for your help! I was able to get it working and get all the data imported after a little tinkering. Also, that server lag? It's a perpetual slow spot outside of chicago that I seem to run into using traceroute, so I don't think it's Batch Child Editor...
  15. Thanks for your good eyes. I'll go line by line first thing tomorrow...
  16. So this code: $subjects = $pages->find("template=subject, limit=100, sort=title"); foreach($subjects as $subject) { echo "<option value='".$sanitizer->alpha($subject->title, Sanitizer::translate)."'>{$subject->title}</option>"; } Does product the single name dropdown, lower case without the & or spaces. <option value='artandculture'>Art and Culture</option> <option value='mapsampgeo'>Maps &amp; Geo</option> <option value='Science'>Science</option> I thought it was working, but realized I need to include a leading PERIOD in the option value before the name in order for mixitup to work... : <option value='.mapsampgeo'>Maps &amp; Geo</option> <option value='.artandculture'>Art and Culture</option> Is there a way using this sanitize string to add the "." back in or do I need to go back to 2-3 steps to launder stuff out?
  17. It is... just don't know how to code that... I haven't tried this... but something like this? foreach($subjects as $subject) { $submix = $subject->title; $submix = ($sanitizer->alpha('$submix', Sanitizer::translate) ) ; echo "<option value='.$submix'>{$subject->title}</option>" ; }
  • Create New...