Jump to content

Search the Community

Showing results for tags 'bootstrap'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

  1. Disclaimer This is not a step by step tutorial, but the script posted serves as an example of how easy it is to bootstrap ProcessWire(PW), query an external API (in this case, Strava) and import stuff into PW pages using the PW API. To the import! So i wanted a quick, easy and automated way to import someones Strava activities into his/her own 'activity feed' on a certain PW website. Strava has an API which you can use to -amongst other things- get your own activity data. After setting up my Strava app i had access to the API. Next step was to import the JSON data i wanted into PW pages. This was as easy as creating a PW bootstrapped script (see code below) and using the PW API to import the data into Pages. For convenience in talking to the Strava API i used a library that is available on Github. To keep track of what was happening i decided it would be nice to log the import results to a log file. Luckily, PW had me covered by using the WireLog class (/wire/core/WireLog.php). Result With some googling on Strava and a (very) basic knowledge of PHP and the PW API i was able to get things working in no-time. With no other CMS i've worked with -and i've had dealings with quite a few- it would have been so easy to get the desired result. Some notes about the script: PW version used: 2.4.12, but should work in earlier versions as well. It does not create templates, fields and pages for you. If you would want to use it (maybe as a starting point), create templates, fields and pages for your own needs and adjust the script accordingly. Also remember to adjust script paths. In the posted example i don't do any sanitizing on the Strava data. You maybe should In production you would maybe call these kind of importers via a cronjob, and make it non-accessible from the outside. It served my purposes. There might be better ways of handling this stuff. All suggestions and/or questions are welcome. In this case the script was/is called importer_strava.php , located at mydomain/importer/importer_strava.php and requested manually. See notes above, number 3. <?php /** * Strava Importer * * This crude script will import your own Strava activities into newly created * PW pages under a given parent page. The import result will be logged in: * /site/assets/logs/importer_strava.txt, using the WireLog class. * * For this to work you first need to create an app via http://www.strava.com/developers * Strava API reference: http://strava.github.io/api/ * * The PHP library used for working with the Strava v3 API can be found at: * https://github.com/iamstuartwilson/strava * */ // Bootstrap Processwire include __DIR__ . '/../index.php'; // Include the PHP Library for working with the Strava v3 API include __DIR__ . '/StravaApi.php'; // Strava credentials (you can get these from the Strava app page you've created) $clientId = "Your clientId"; $clientSecret = "Your clientSecret"; $accessToken = "Your accessToken"; // Connect to Strava $api = new StravaApi( $clientId, $clientSecret ); // Set the parent where activities will be stored as child pages $activity_parent = wire('pages')->get("/activities/"); // Get new activities $results = $api->get( 'athlete/activities', $accessToken, array( 'after' => $activity_parent->strava_last_checked ) ); // Uncomment if you want to inspect the $results response onscreen // echo "<pre>"; // print_r($results); // echo "</pre>"; // Import new Strava activities to PW Pages if (empty($results)) { // Log that no activities have been imported $text = "No new activities have been imported"; $options = array('showUser' => false, 'showPage' => false); wire('log')->save('importer_strava', $text, $options); } else { $numImportedPages = 0; // Start counter for number of imported pages foreach ($results as $result) { $p = new Page(); // Create new page object $p->template = 'activity'; // Set template $p->parent = $activity_parent; // Set the parent // Assign $result data to the corresponding Page fields $p->name = $result->id; $p->title = $result->name; $p->act_distance = $result->distance; $p->act_moving_time = $result->moving_time; $p->act_elapsed_time = $result->elapsed_time; $p->act_total_elevation_gain = $result->total_elevation_gain; $p->act_type = $result->type; $p->act_start_date = substr($result->start_date_local, 0, 10); $p->act_average_speed = $result->average_speed; $p->act_start_lat = $result->start_latlng[0]; $p->act_start_long = $result->start_latlng[1]; $p->act_end_lat = $result->end_latlng[0]; $p->act_end_long = $result->end_latlng[1]; $map = $result->map; $p->act_map_polyline = $map->summary_polyline; $p->save(); // Save the Page object $numImportedPages++; // Increment counter } // Log the number of activities that have been imported $text = ($numImportedPages == 1) ? "$numImportedPages new activity imported" : "$numImportedPages new activities imported"; $options = array('showUser' => false, 'showPage' => false); wire('log')->save('importer_strava', $text, $options); // After the import, update Field 'strava_last_checked' to current Unix timestamp // This could also be placed outside of the 'else' to update on each script run $timestamp = $activity_parent; $timestamp->of(false); // Turn off output formatting before saving things $timestamp->strava_last_checked = time(); $timestamp->save('strava_last_checked'); }
  2. Hello, I'm working with the include& bootstrap API in order to include content from a different PW installation in my main website. It seems to work correctly, but sometimes (once per week) the page doesn't receive data from processwire (All the images and text are not showing) The only way I found to solve this is... login to the processwire admin page. Instantly the API starts to work again. This is the code I use: <?php function listPage($page, $level = 0) { if($page->numChildren) { foreach($page->children as $child) { ?> <div class="6u"> <div class="row"> <div class="6u box240 boxtext bg-color-events"> <h3><?php echo $child->title ?></h3> <p><?php echo $child->summary ?></p> <a class="scopri color-events" href="eventi?detail=<?php echo $child->name ?>"><span>scopri</span></a> </div> <a href="eventi?detail=<?php echo $child->name ?>"> <div class="6u box240 imghover color-events"> <?php $cover = $child->cover->first(); ?> <img src="/news<?php echo $cover->url;?>" alt="Vai al dettaglio dell'evento"> </div> </a> </div> </div> <?php } } }?> ..... <?php { listPage($wire->pages->get("/eventi/")); } ?> Did it ever happen to you? Any ideas about the possible cause?
  3. Prerequisites: Basic knowledge of git and git submodules A git hosting solution (e.g. GitHub) No aversion against bash commands Once you've built a couple of websites with it, a set of your own personal must-have modules emerges. For me, such a module and always the first install of the day is Soma's MarkupSimpleNavigation. But there's also MarkupSitemapXML. And so on. Depending on your usage of ProcessWire, the type of pages you build with PW or your customers, your set of modules may differ. Installing modules and functionalities that you'll need in most instances should be an automated and easy process. ProcessWire itself offers a range of possibilities to do so. First, there is installation via ClassNames: In Backend, chose "Modules", then "New" and paste or type in the class name the desired module established in the PW ecosystem, for example `LoginPersist`. From that point on, the particular module gets downloaded and installed within two clicks and just a matter of seconds. Rinse and repeat until your starter module set is complete, but be sure to memorize or note the correct class names. Secondly, you can create an own starter site profile with your modules in it. This not only gives you the means to bootstrap in a module related way but also many possibilities for template and field groundwork. But a disadvantage (on the module site) remains: Unless you control and update all the modules in your site profile, only certain, possibly outdated versions will be installed - and you have to manually update them afterwards. For my last few projects I found a third way: Bundling all starter/must-have modules together in a git repo, using the modules as git submodules. After ProcessWire installation on my local machine, I just clone this bundle and recursively pull every module's master to its latest commit. An example (with my set of starter modules): cd site/modules && git clone --recursive git@github.com:marcus-herrmann/ProcessWire-BootstrapModuleSet.git && cd ProcessWire-BootstrapModuleSet && git pull --recurse-submodules What does this code do? At first, let's assume you've navigated via the terminal to you ProcessWire's installation root folder. Afterwards, these steps follow: 1. Change directory to module folder 2. Clone your bundle repo 3. Change directory to the folder created by aforementioned bundle repo clone 4. Pull all submodules to their latest commit That's all. After you've created your own module bundle repo, you can even create a bash alias for this and accellerate the process even more: alias getpwstartmodules='cd site/modules && git clone --recursive git@github.com:marcus-herrmann/ProcessWire-BootstrapModuleSet.git && cd ProcessWire-BootstrapModuleSet && git pull --recurse-submodules' I possibly may have reinvented the wheel. But at least I haven't yet found such a way for "PW kickstarting" before (apart from maybe pure bred package managers such as npm and composer). But if a better solution exists, please do not hesitate to drop a comment here Disclaimer: This is also a blog post
  4. Hi there, I would like to access the ProcessWire API from another PHP application at runtime and this is quite straightforward. However, I wonder if there is any guidance about URL re-writing and the general requirements for accessing the ProcessWire Admin/User pages for the loading of content which will not be done through the application consuming the ProcessWire API. Thanks.
  5. On this page we have allowed the customer to create their own Paypal cart button for a list of products http://www.inspirefit.co.uk/clothing/ Previously, we would use the image resize functions built in to Processwire (you know image->size(200,150) and all that) but to make an image work in Bootstrap 3 we need to allow it to do it's thing - ie remove this sizing statement. Bootstrap then applies its css: width: 100%; height: auto; But... as you see on this page, the client has uploaded massive images and the system has not cached anything. Giving us an undesirable pages of well sized but big image files. Is there a solution to this at all?
  6. As being a active member of this sports club, i've been asked to take over the website-development, so i'm developing this site in my spare time. http://tbe1844.de Developed first with Twitter Bootstrap v.2, but then converted it to version 3, which went comparatively smooth and easy. Every section could be managed by the staff from this section by restricting admin access for paths to users. This is still in development, especially the event managment needs some engagement. It is planned that it should be easy to generate a view of events distinct to a section or team and display this in a calendar or list... I implemented also a ranking list for the beach volleyball teams. It is based on the ELO-system used by chess or table soccer, the ranking points you get for a win or loss are calculated based on the points for both teams before the game. The ranking list is private, so if you wanna take a look, send me a pn. Modules used: Image thumbnails Fredi Hanna Code (you can insert tooltips to persons and locations in the editor) Page edit per user Map Marker
  7. Hi all, I'm building a new section on to an existing Joomla (1.5) site. I think the PW admin interface will be great for this purpose and so I've setup PW in a subdirectory of the main site. All installs well, but I'm running into issues when I try to include the PW bootstrap file in a Joomla template. I simply add: include("admin/specials/index.php"); where 'specials' is my PW root. What I end up with is this error" "Class 'JDocumentRenderer' not foundClass 'JDocumentRenderer' not found in /libraries/joomla/document/html/renderer/modules.php" Is there another way for me to include PW that might remove any conflict with Joomla? I am running 5.3 if that matters. Thanks!
  8. Eketorp is an open-air museum located in the south east of sweden on the island of Öland in the Baltic sea. The museum is a part of Kalmar Läns Museum (Kalmar County Museum). The site's front end is based on Twitter Bootstrap and Jquery Mobile. The ajax search was kindly developed by Soma after a request on the IRC channel. Big thanks to you Soma! If you visit Öland you really should go, it’s a pretty cool place. Thank you Ryan for an excellent system! Happy midsummer! Mats
×
×
  • Create New...