Jump to content

zgjonbalaj

Members
  • Posts

    9
  • Joined

  • Last visited

zgjonbalaj's Achievements

Newbie

Newbie (2/6)

2

Reputation

  1. Thanks for your reply Mr. Pirate, i actually decided to try just creating them as pages with a fileless template called accordion-tab. I noticed that automatically if you try and visit the url of that page its a 404 and its nowhere on the site. Its like Ryan Cramer read my mind here. I will try the page table or the multiplier in a better suited environment or client in the future. I've purchased all the modules but haven't really gotten a chance to try them all out yet. I think once i saw that these pages can be treated like objects in this fashion that is without an actual template file it just felt right to me so ill go with that for now. Thanks for your time and advice.
  2. Hey Guys, I have a client who is passionate about accordions in that he uses almost an entire page as a "tab" in the accordion. My original solution was to create a repeater with a title, ckeditor & images field. One of the problems i'm facing now is that sometimes the ckeditor does not link to the appropriate images field right underneath it and its getting way to cluttered. I am not sure if this is a bug or a general issues but my alternative is to create sub pages underneath the parent but i have a few questions on how you guys would approach this or if my idea below makes sense. 1. Since i do not want these pages appearing anywhere else (navigation, sitemap, etc) but also want to give the client the ability to hide or unpublish these pages should i create them using a fileless template vs. excluding them in every other nav output throughout the site. 2. If anyone were to visit the URL of that specific tab somehow, how do i make sure it shows up as a 404? Also will the sitemap module pick these up? 3. Any other ways of handling this? Running PW 2.7.3
  3. We've been using PW since 2.3 for a lot of our websites and have found it to be suitable in almost any scenario it just seems there is nothing it cant handle. The clients love it because its easy to use and very intuitive. The Pro Forms module has also made our lives just a little easier when it comes to creating front end forms. Every now and then we come across a problem and we've always found a way to make it work with PW. With that said, I was hoping to get an idea from other developers what their approach is and what might be the best route to choose in terms of best practices in the following scenarios. 1. Repeaters or Pages We know that repeaters are essentially pages living under the admin tree. In a case where there may not be that many repeatable items we want to maybe just allow the client to create sub-pages (children) under a specific page in the back end. We always wondered if this is a good idea since we don't want the visitor, search engine bots, etc to be able to crawl or view those pages directly. Whats the best option here? Unpublished? Hidden? Template without file? Essentially how do we create pages that can be pulled by the api but do not serve any other purpose such as no url, not visible on the front end, etc? 2. Assets We just recently built a site where our client had several hundred in assets varying in type such as webinars (video template), white-papers (direct pdf download), podcasts (direct mp3 download), success stories (regular html template) etc. We created an unpublished page in the root and had 5 published children underneath that page considered as type. SEO value was important to us for all of these assets. How do you guys normally handle these types of assets what is the proper approach in PW. 3. Drafts We've posted this question before and seems its under development but im wondering how do you handle a scenario where you need to preview changes on the home page for example before pushing it live? We tried the ProcessPreview Module but that doesnt seem to work well with our custom classes and functions. Basically our client needs to make changes to a page send a link for approval and only once it is approved apply the changes. For other pages we normally duplicate it add a "v2" at the end and keep it unpublished, send the url, get the approval and then either merge the changes manually or delete the original entirely and rename the v2 to the original name then publish it. This process is tedious and it doesn't work for the home page. I may have been vague in my questioning but i hope you get my general point. Im just looking for some direction and assistance on how to approach these scenarios.
  4. Issue: I get a MySQL server has gone away error at the end of the page, debug is true. Setup: The page template that this error occurs on connects to a Citrix Sharefile system and pulls all the files and folders for that user upon login using the Citrix PHP API. The delay in getting all these assets is long but the client is ok with that. I was hoping to find a way where I can have PW load the page and then begin loading the resources without throwing this error. Here is the page step by step process ( find the page source at the bottom of this post ): - Require sharefile api resources (php include) - If user posted login information through $_POST login the user and set necessary session variables - display doc header - begin displaying content elements on the page such as h1, p's etc - connect to sharefile using authenticated user and pull all data from share file and output - display footer & necessary script Error: Error: Exception: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away (in /nfs/c11/h05/mnt/204835/domains/longpointcapital.com/html/wire/core/PageFinder.php line 297) #0 [internal function]: PageFinder->___find(Object(Selectors), Array) #1 /nfs/c11/h05/mnt/204835/domains/longpointcapital.com/html/wire/core/Wire.php(387): call_user_func_array(Array, Array) #2 /nfs/c11/h05/mnt/204835/domains/longpointcapital.com/html/wire/core/Wire.php(325): Wire->runHooks('find', Array) #3 /nfs/c11/h05/mnt/204835/domains/longpointcapital.com/html/wire/core/Pages.php(206): Wire->__call('find', Array) #4 /nfs/c11/h05/mnt/204835/domains/longpointcapital.com/html/wire/core/Pages.php(206): PageFinder->find(Object(Selectors), Array) #5 [internal function]: Pages->___find('parent_id=1, te...', Array) #6 /nfs/c11/h05/mnt/204835/domains/longpointcapital.com/html/wire/core/Wire.php(387): call_user_func_array(Array, Array) #7 /nfs/c11/h05/mnt/204835/domains/longpointcapital.com/html/wire/core/Wire.php(325): Wire->runHooks('find', A <? ini_set('mysql.connect_timeout', 1200); // Start Session (PW Already Does This) session_start(); // ShareFile API require_once("_includes/sharefile-api.inc"); // Destroy Session After Inactivity if (isset($_SESSION['LAST_ACTIVITY']) && (time() - $_SESSION['LAST_ACTIVITY'] > 600)) { unset($_SESSION['sharefile']); } // Update Session $_SESSION['LAST_ACTIVITY'] = time(); // Enable ProcessWire Debugging $config->debug = true; // Logout if (isset($input->post->logout)) { unset($_SESSION['sharefile']); } // CSRF Protection $tokenName = $this->session->CSRF->getTokenName(); $tokenValue = $this->session->CSRF->getTokenValue(); $loggedIn = false; $token = null; // Include Login Form Processor if ($input->post->email && !$loggedin) { require("_includes/sharefile-form.inc"); } // Check if user athenticated if (isset($_SESSION['sharefile'])) { $loggedIn = true; $token = $_SESSION['sharefile']; } // Download File if (isset($input->get->download)) { require("_includes/sharefile-download.inc"); } function iterateObject($token, $object) { $object = get_children($token, $object); if ($object["odata.count"] >= 1) { foreach ($object['value'] as $child) { # Create container if (strpos($child['odata.metadata'], "Folder@Element") !== false) { echo "<div class='col-xs-12 folder-container'> <div class='folder'>"; echo " <span class='glyphicon glyphicon-folder-close'></span><span class='name'>" . $child['Name'] . "</span>"; iterateObject($token, $child['Id']); echo " </div> </div>"; } else { echo "<div class='file'> <a target='' class='name' href='/investor-login/?download={$child['Id']}&name={$child['Name']}'><span class='glyphicon glyphicon-file'></span> " . $child['Name'] . "</a> -- <span class='size'>" . $child['FileSizeInKB'] . "KB</span> </div>"; } } } } // Include Doc Header require("_includes/doc-header.inc"); ?> <body class="<?= $page->name ?>"> <div class="clearfix oc-container oc-left oc-js"> <div class="oc-overlay oc-js"></div> <!-- Include Common Header --> <? require("_includes/header.inc"); ?> <section class="container"> <div class="row"> <? if ($formSubmitted || $loggedIn && $failedAuth != true): ?> <? if ($loggedIn): ?> <div class="col-xs-12 col-sm-7 col-md-8 left-column investor-portal"> <h1>Welcome</h1> <p><p>If you have any questions regarding your account, please contact our Office Administrator (<a href="#">#</a>), for more information.</p></p> <div class="row"> <?= iterateObject($token, "allshared") ?> </div> </div> <div class="col-xs-12 col-sm-5 col-md-4 sidebar-column"> <form class="logout-form" action="" method="post"> <button id="logout" name="logout" type="submit" class="btn btn-default btn-logout">Logout</button> </form> </div> <? else: ?> <div class="col-xs-12 col-sm-7 col-md-8"> <?= $formOutput ?> </div> <? require("_includes/sharefile-loginform.inc") ?> <? endif ?> <? else: ?> <div class="col-xs-12 col-sm-7 col-md-8"> <?= $page->body ?> </div> <? require("_includes/sharefile-loginform.inc") ?> <? endif ?> </div> </section> <!-- Footer --> <? require("_includes/footer.inc"); ?> <script> $(document).ready(function() { $(".folder span.glyphicon").click(function(event) { var container = $(this).parent('.folder'); var files = container.children('.file, .folder-container'); $(this).stop().toggleClass('glyphicon-folder-close glyphicon-folder-open'); files.stop().toggle(); }); }); </script> </div> <!-- End Off Canvas --> </body> </html>
  5. Thanks for your reply, just got it all set-up. You wouldn't happen to know how i can pull all the options available in each select options field directly?
  6. Hello, I am wondering if i could get some feedback to see how to approach this simple problem and what the best practice is through PW. I currently have a site that has "Portfolio Companies" as pages, each portfolio company has 3 attributes "Status" , "Sector" & "Transaction". I'd like to have in the backend the ability for the user to select multiple options for each attribute. For example "Company A" belongs in 2 sectors and its status is "One" and has no transaction attribute. My approach to this would normally have been create a page under the root called "Filters" that is hidden and create 3 subpages named after each of the filters and for each of those subpages create the necessary options as subpages. Then i would create a multiple page select field for each filter that is bound to those subpages. This works and is fine however I am wondering if there is a better way and if this is the right way to do it after all. In the front end i would output this as a dropdown. I downloaded a select field dropdown module but does not allow multiple options to be selected. Any ideas, suggestion greatly appreciated. Thanks in advance!
  7. Wanting to begin work on a module that does simple SEO tasks and then possibly expand it further. As of right now I'm hoping to create a module that pulls the title, headline & description field for each page and also all images with their description fields. Is it possible to retrieve all images even from repeaters in each page? What do you think the right approach for this would be?
  8. UPDATE: FIXED THE ISSUE Hope this helps someone but it seems the culprit was the php memory limit set to 32M. I increased this to 128M and everything works fine. I added ini_set('memory_limit', '128M'); to the init() on ModulesManager.module but will sooner or later be updating the php.ini to increase this. I recommend that maybe this be included in ModulesManager for those servers with low memory limit. Yea the cache is there this is what comes up for the modules manager in the cache, also when clicking on refresh at the top right the page simply doesn't load it will post the request i see the get param but the page doesn't return anything but empty head & body. Update: The page returns this when clicking refresh Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 262144 bytes) in /home/ascentav/public_html/site/modules/ModulesManager/ModulesManager.module on line 801 Error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 262144 bytes) (line 801 of /home/ascentav/public_html/site/modules/ModulesManager/ModulesManager.module) This error message was shown because site is in debug mode ($config->debug = true; in /site/config.php). Error has been logged. Note: Debug Mode tools shows that both ModulesManager & jQueryDataTables have been loaded also when opening ModulesManager I do notice that it is pulling the number of modules because it shows this: Modules found on modules.processwire.com (319) {"id":1136,"class_name":"ModulesManager","name":"modules-manager","title":"Modules Manager","summary":"Module Manager enables you to browse the modules directory on modules.processwire.com, download, install or update them.","version":215,"module_version":"2.1.5","created":1343336504,"modified":1418136602,"url":"http:\/\/modules.processwire.com\/modules\/modules-manager\/","details_url":"http:\/\/modules.processwire.com\/export-json\/modules-manager","requires":["JqueryDataTables"],"requires_versions":{"JqueryDataTables":[">=",0]},"installs":[],"author":"Philipp 'Soma' Urlich","icon":"","likes":59,"release_state":{"id":1084,"name":"beta","title":"Beta","url":"http:\/\/modules.processwire.com\/release-states\/beta\/"},"pw_versions":[{"id":1012,"name":"2.2","title":"2.2","url":"http:\/\/modules.processwire.com\/versions\/2.2\/"},{"id":1216,"name":"2.3","title":"2.3","url":"http:\/\/modules.processwire.com\/versions\/2.3\/"},{"id":1377,"name":"2.4","title":"2.4","url":"http:\/\/modules.processwire.com\/versions\/2.4\/"},{"id":1466,"name":"2.5","title":"2.5","url":"http:\/\/modules.processwire.com\/versions\/2.5\/"}],"categories":[{"id":1078,"name":"admin-helper","title":"Admin Helpers","url":"http:\/\/modules.processwire.com\/categories\/admin-helper\/"},{"id":1018,"name":"process","title":"Process Modules","url":"http:\/\/modules.processwire.com\/categories\/process\/"},{"id":1080,"name":"proof-of-concept","title":"Proof of Concept","url":"http:\/\/modules.processwire.com\/categories\/proof-of-concept\/"}],"authors":[{"id":1050,"name":"soma","title":"soma","url":"http:\/\/modules.processwire.com\/authors\/soma\/"}],"project_url":"https:\/\/github.com\/somatonic\/ModulesManager","download_url":"https:\/\/github.com\/somatonic\/ModulesManager\/zipball\/master","forum_url":"http:\/\/processwire.com\/talk\/topic\/1550-modules-manager\/"}
  9. Hello, Having an issue with one of our PW sites running PW 2.5.3 & Modules Manager v215. Modules manager simply doesn't load any of the modules on processwire.com. Inspecting the page with Chrome Developer Tools shows this error in the console from jQuery Data Tables. Uncaught TypeError: Cannot read property 'sError' of nulljquery.dataTables.min.js?v=194:132 k.jqXHR.h.ajax.successJqueryCore.js?v=183:2 lJqueryCore.js?v=183:2 c.fireWithJqueryCore.js?v=183:2 TJqueryCore.js?v=183:2 r Any suggestions? I've attempted to reinstall jQuery Data Tables & Modules Manager as well. Also just updated to ModulesManager v215 same issue. Looked at the jquery.dataTables.js and this is the code where the error is being thrown "fnServerData": function ( sUrl, aoData, fnCallback, oSettings ) { oSettings.jqXHR = $.ajax( { "url": sUrl, "data": aoData, "success": function (json) { if ( json.sError ) { oSettings.oApi._fnLog( oSettings, 0, json.sError ); } $(oSettings.oInstance).trigger('xhr', [oSettings, json]); fnCallback( json ); }, "dataType": "json", "cache": false, "type": oSettings.sServerMethod, "error": function (xhr, error, thrown) { if ( error == "parsererror" ) { oSettings.oApi._fnLog( oSettings, 0, "DataTables warning: JSON data from "+ "server could not be parsed. This is caused by a JSON formatting error." ); } } } ); },
×
×
  • Create New...