-
Posts
76 -
Joined
-
Last visited
Everything posted by icreation
-
Processwire 3 - using the API in Open Cart - wee hitch
icreation replied to icreation's topic in API & Templates
Just seen this WillyC - thanks -
Processwire 3 - using the API in Open Cart - wee hitch
icreation replied to icreation's topic in API & Templates
Funnily enough the field is set to Maximum files allowed = 1 but the ..first()-> statement has worked. Many thanks. -
Hi With Processwire 3.x it seems that now the API really works in other applications that didn't before. Open Cart is a good open source e-commerce platform but the CMS capabilties are limited. I always wanted to be able to integrate PW fields into OC and now it seems possible. However there is a problem that I cannot overcome. Once I add in the ref to the index.php I have full access to all the fields in $page->id == 1 This is added to the home.tpl template page in Open Cart and seems to mostly work. include("/home/shutterblue/public_html/content/index.php"); $homepage = $wire->pages->get(1); from there all the fields can be echo'd, for example: $homepage->title, etc. I have a repeater and 2 text fields: The repeater is named 'homeboxes' - with fields called 'homeboximage', 'homeboxtitle'. <?php foreach($homepage->homeboxes as $homebox): ?> <div class='col-xs-3 default-mobile'> <div class='block-content'> <img src="<?php echo $homebox->homeboximage->url; ?>" alt="<?php echo $homebox->homeboxtitle; ?>" class="img-responsive" /> <div class="bs-text-down text-center"> <?php echo $homebox->homeboxtitle; ?> </div> </div> </div> <?php endforeach ?> The 'homeboxtitle' echos out pefectly but the 'homeboximage->url' does not. Instead of showing image url's like this: <img src="/content/site/assets/files/1021/crop_5d3_0451_fr.jpg" alt="Home box title" class="img-responsive" /> I get this: <img src="/content/site/assets/files/1021/" alt="Home box title" class="img-responsive" /> Any idea?
-
Thanks for the replies. Appreciated.
-
I have a field type datetime that I have configured in PW backend. However, I want to split this down so that I can display the day and month/year separately. echo $page->datefield; Gives me the full date that looks like '8 November 2015' How do I express the PHP code to just echo the '8'. Then just echo the 'November 2015' ?
-
Thanks for the replies. They are on the same domain with all the tables on the same database. The JSON method is sound, however I was trying to use the existing ability that WP has for embedding in other environments. However, a little bit of thought has come up with a method. It is not ideal that we are modifying the core files on both application so I would welcome an improvement to this method. Here is how to get a working Processwire website working with a Wordpress Blog. The blog posts can be displayed on the front page. The PW navigation bar will display dynamically on the WP pages. 1. In Wordpress add this to the /wp-content/themes/.../functions.php if (strpos($url,'/blog/') !== false) { include("/path/to/processwire/index.php"); } $global = wire('pages')->get(1); 2. In Wordpress add this to the top of /wp-content/themes/.../header.php global $global; 3. In Processwire wire/core/LanguageFunctions.php and also in Wordpress /wp-includes/l10n.php Wrap these 3 functions with if statements to stops them being declared again. if (!function_exists('__')) { ... } if (!function_exists('_x')) { ... } if (!function_exists('_n')) { ... } 4. One error that seems to occur is that any instances of $pages->get(...); needs to be replaced by wire('pages')->get(...); as detailed in PW documentation.
-
According to this page http://codex.wordpress.org/Integrating_Wordpress_with_Your_Website it should be easy to bring Wordpress posts onto a page. However, using this method in PW it is giving me an Internal Server Error. Any idea how this could be done, the databases are in the same location.
-
It is just an image field in a repeater called sideimage_1
-
When I try to save the image to 'referrer' i get the following error. Error: Call to a member function get() on a non-object (line 88 of /home/candgnew/public_html/site/modules/PixlrEditor/ProcessPixlrEditor.module) This error message was shown because you are logged in as a Superuser. Error has been logged. This was on PW2.6 - can you help?
-
Thanks very much. Module works fab, nice job
-
Hi, I installed this module on 2.5.25 version and as soon as I tried to create a new field I got the following error. Any ideas? Error: Using $this when not in object context (line 112 of /home/maloco15/public_html/site/modules/FieldtypeSelectExtOption/FieldtypeSelectExtOption.module) This error message was shown because you are logged in as a Superuser. Error has been logged
-
I can confirm this. When you are inside a croppableimage that is inside a repeater it brings up the modal but the tools and buttons are missing so you can't crop or save.
-
Using Processwire with Open Cart (or other applications)
icreation replied to icreation's topic in API & Templates
I have both installation in the same database and root directory. On adding the following statement based on Craig's suggestion above I get: require_once(DIR_SYSTEM . "../processwire/index.php"); Internal Server error 500. it is the correct path but the Processwire API will just not work here it seems.- 11 replies
-
- developer api
- other applications
-
(and 1 more)
Tagged with:
-
Using Processwire with Open Cart (or other applications)
icreation replied to icreation's topic in API & Templates
Yes, I get a 500 internal server error. Trying other relative urls gives Warning: include(../processwire/index.php) [function.include]: failed to open stream: No such file or directory in /home/opencart/public_html/catalog/view/theme/default/template/information/information.tpl on line 18Warning: include() [function.include]: Failed opening '../processwire/index.php' for inclusion (include_path='.:/usr/lib/php') in /home/opencart/public_html/catalog/view/theme/default/template/information/information.tpl on line 18 Notice: Undefined variable: wire in /home/opencart/public_html/catalog/view/theme/default/template/information/information.tpl on line 31Notice: Trying to get property of non-object in /home/opencart/public_html/catalog/view/theme/default/template/information/information.tpl on line 31 Fatal error: Call to a member function get() on a non-object in /home/opencart/public_html/catalog/view/theme/default/template/information/information.tpl on line 31- 11 replies
-
- developer api
- other applications
-
(and 1 more)
Tagged with:
-
Using Processwire with Open Cart (or other applications)
icreation posted a topic in API & Templates
I wish to use Processwire to extend the CMS functionality that is limited in Open Cart and thought of having a /processwire subdirectory and using the API as described in http://processwire.com/api/include/ However, I have stumbled at the first block by trying to include the Processwire index file. I get an error. I tried these: <?php include('/home/opencart/public_html/processwire/index.php'); <?php include('http://absoluteurl/index.php'); <?php include('../../..relativeurl/index.php'); Can someone give more detail on how to access the Processwire API from an external application?- 11 replies
-
- developer api
- other applications
-
(and 1 more)
Tagged with:
-
Image resize corruption - black lines on PNG
icreation replied to icreation's topic in General Support
Many thanks for taking the time on such detailed answers, it is much appreciated. I will have a good look at this today.- 4 replies
-
- png
- black line
-
(and 1 more)
Tagged with:
-
My client is uploading images via CK Editor into a textarea. The image type is a transparent PNG like the one attached (head-three.png) However when Processwire resizes this image there are little black line all through. See the 'head' image on this page - http://thinkingtosuccess.co.uk/business/#tab2 The original image is attached. How can we avoid these black lines causing the image corruption?
- 4 replies
-
- 1
-
- png
- black line
-
(and 1 more)
Tagged with:
-
Got it thanks !
-
Fantastic thanks! What if I want to allow the client to select from a number of crop options in their admin area (square, portrait and landscape). How would the syntax go so that getThumb() delivers the selected crop?
-
Thanks for coming back to me. I cannot get this to work and just wondered about the syntax for this? The name of my field is sideimage and this would normally be called by <?php echo '<img src="'.$page->sideimage->url." />'; ?> If I change the type of image to cropImage what would be the syntax to call this image?
-
Using PW2.5.3 the field seems to work nicely. In the PAGE edit the options are there - nice: .. but this is not working on the front end. I know that I need to do something in the template and have tried the following. <?php echo $page->image->eq(0)->getThumb(); ?> Can someone help me to get the statement correct for the image in the template?
-
That fixed it. Many thanks for that
-
Thanks for responding Wanze. When I try to uninstall the module as a superuser it tells me "This page may not be deleted".
-
From a fresh installation of PW2.5 with a profile that I made I get the following error when trying to access the 404 page. Error: Exception: Table 'perfects_db.ProcessRedirects' doesn't exist (in /home/perfectserviceso/public_html/wire/core/Database.php line 114) #0 [internal function]: Database->query('SELECT id, redi...') #1 /home/perfectserviceso/public_html/wire/core/DatabaseMysqli.php(35): call_user_func_array(Array, Array) #2 /home/perfectserviceso/public_html/site/modules/ProcessRedirects/ProcessRedirects.module(261): DatabaseMysqli->__call('query', Array) #3 /home/perfectserviceso/public_html/site/modules/ProcessRedirects/ProcessRedirects.module(261): DatabaseMysqli->query('SELECT id, redi...') #4 /home/perfectserviceso/public_html/wire/core/Wire.php(411): ProcessRedirects->checkRedirects(Object(HookEvent)) #5 /home/perfectserviceso/public_html/wire/core/Wire.php(344): Wire->runHooks('pageNotFound', Array) #6 /home/perfectserviceso/public_html/wire/modules/Process/ProcessPageView.module(179): Wire->__call('pageNotFound', Array) #7 /home/perfectserviceso/public_html/wire/modules/Process/ProcessPageView.module(179): ProcessPageVi This error message was shown because you are logged in as a Superuser. Error has been logged. Can anyone see if something is missing here?
-
Don't lose site of the fact that in the case of the problem that I have posed the PAGE TREE cannot be changed. The reason is the page hierarchy of the pages must be intuitive to a non-technical client using the Processwire interface. Creating any kind of redirect does not get round the problem of breadcrumbs or SEO. The simple request is merely to change (somehow) www.domain.com/firstpage/secondpage to www.domain.com/secondpage That is the only solution that will work.