Jump to content

Manol

Members
  • Posts

    292
  • Joined

  • Last visited

Everything posted by Manol

  1. Hello roelof. Check this line of code. $paginasCatalogo = $page->imagenes_catalogo; It will load just images. Imagine you create a page with the name of magazine, there you upload images in my case I choose "imagenes_catalogo" as the images field.
  2. Hello Soma. Works perfectly! on localhost. Is it possible to include some 'must' moduls as well?. Regards.
  3. Hello everybody. Would you like to start a topic about the prices you would charge for a whole webpage or parts (modules) of it ? I know it depends on each project but we can get a general idea and by the way we know how much you charge on your country. Somebody has the knowledge or time to do a form that we can fill up with the prices , for example how much would you charge to implement a forum, couple languages, blog, contact form, for de design... Regards.
  4. Fantastic apeisa, I'll give it a try, angularjs is awesome, in my opinion is more natural than backbone although finding some difficulties to make it work with jquerymobile. I'll try to learn from your code and give you some feedback.
  5. Hello Soma that sounds like a good solution, thank you.
  6. I let here some code in an early stage, is a turn page, here is an example <?php include("./head.inc"); ?> <style> /*---------------------------- Styling the magazine -----------------------------*/ #magazine{ width:800px; height:520px; margin:0 auto; position:relative; left:0; opacity:0; -moz-transition:0.3s left; -webkit-transition:0.3s left; transition:0.3s left; } #magazine .page{ width:520px; height:520px; background-color:#ccc; overflow:hidden; } /* Center the magazine when the cover is shown */ #magazine.centerStart{ left:-260px; } /* Center the magazine when the last page is shown */ #magazine.centerEnd{ left:260px; } .page img{ height:520px; width:520px; display:block; } .centerStart .turn-page-wrapper:first-child{ box-shadow:0 0 10px #040404; } /* Page Numbers */ span.pageNum{ background-color: rgba(0, 0, 0, 0.3); bottom: 25px; box-shadow: 0 0 3px rgba(0, 0, 0, 0.25); color: #FFFFFF; font-size: 11px; height: 24px; line-height: 22px; opacity: 0.9; position: absolute; text-align: center; width: 55px; } span.pageNum.left{ left:0; right:auto; } span.pageNum.right{ left:auto; right:0; } /* Hide the page number on the cover */ #page1 .pageNum{ display:none; } </style> <!-- catalog page flip neccesary files--> <script type="text/javascript" src="<?php echo $config->urls->templates?>scripts/turn.js"></script> <script type="text/javascript" src="<?php echo $config->urls->templates?>scripts/script.js"></script> <div id="magazine" class="centerStart"> <?php $paginasCatalogo = $page->imagenes_catalogo; $index = 0; foreach ($paginasCatalogo as $pagina){ $index++; echo "<div id='page{$index}' class='page'>". "<div class='img{$index}'>". "<span class='pageNum right'>{$index}</span>". "<img src='$pagina->url' alt='' />". "</div>". "</div>"; } ?> </div> <?php include("./foot.inc"); ?>
  7. Thank you, I wanted to be able to generate pages from admin as well as importing them from a CSV file which has only the number for each subject ( ex. maths=10).
  8. Hello. 1.- I have created: field type: page input type: checkboxes* label field*: title of the page 2.- the structure of this pages are like this: title: maths , category: 10 title: language , category:11 3.- Is it possible to select from the checkboxes dropdown lets say "maths" and write "10" to the DB ?. Thank you.
  9. Fields > advanded > tags, I gave a name of "table" to the fields I want to appear in a table on the frontend. function renderTablaVehiculo($vehiculo){ $page = wire('pages')->get($vehiculo); $out = "<table class='table table-striped'> <tbody>"; foreach($page->fields as $field) // si en el backend el field tiene la etiqueta 'table' entonces aparece en la salida if(strstr($field->tags, "table") && $page->get($field->name)!="" ) { $out.= "<tr> <td> {$field->label}: </td> <td>" . $page->get($field->name) . "</td> </tr>"; } $out.= "</tbody></table>"; return $out; }
  10. Thank you very much Soma, this is the bit I was missing: $filepath = $config->urls->assets . "data/list-details.json"; Really appreciate your help, it's a pleasure to learn from you and many others in this forum.
  11. It's not a typo, thank you for your help, Dave, Soma and Ryan, in the end I used absolute path, that way it works.
  12. Hello Ryan. I was developing this project with nodejs and backbone, at that time I discovered processwire, and it became an open door to take a different approach. Processwire allowed me the administrator to fill in the various fields, upload images, sounds, texts, etc for each monument in a really easy way, but for mobile users trying to get audios and images for certain monument concurrently is a best idea to let a nodejs server do the job instead of apache. This is the reason for generating json files for each monument indicating where all stuff such audios and images can be found. Maybe I'm wrong with this aproach, I´ll share the results here for anybody who could be interested.
  13. this is my .php under /templates <?php include("./includes/head.inc"); ?> <!-- Content start --> <div data-role="content"> <div id='proximity_list' class='css3-blink '>Buscando lugares de interes cercanos...</div> <div ng-controller='getLitLatLng'> <ul data-role='listview'> <li ng-repeat='lit in lits | orderBy:predicate:reverse'> <a href='{{ lit.url }}' > <h2>{{ lit.title }}</h2> <p>{{ lit.distance }} metros</p> </a> </li> </ul> </div> <!-- ><div id='mymap' ></div> --> </div> <!-- /content end --> <?php include("./includes/foot.inc"); ?> this my js under /templates/js (I use angularjs, maybe that is the reason this is not working) function getLitLatLng($scope, $http) { // check if user has geolocation if(navigator.geolocation) { // Posicion del dispositivo movil navigator.geolocation.getCurrentPosition(function(position) { // get user position x0 = position.coords.latitude; y0 = position.coords.longitude; //create and populate list of lits listalits($scope, $http); });//navigator }//if } function listalits($scope, $http){ /** gets lits information */ $http.get('http://mydomain.com/site/assets/data/list-details.json') /** success file readed */ .success(function(data) { // convert to object $scope.lits = eval(data); // calcula distancias de usuario a lit for(var i in $scope.lits){ metros = (Math.sqrt(Math.pow((x0-$scope.lits[i].lat),2) + Math.pow((y0-$scope.lits[i].lng),2)) * 100000 ); $scope.lits[i].distance = metros; } /** file not readable */ }).error(function(data, status) { alert(" json no leido desde el servidor"); }); //order by distance $scope.predicate = 'distance'; }
  14. '/site/assets/list-details.json' doesn't get the results but 'http://mysite.com/site/assets/data/list-details.json' does. Thank you anyway.
  15. Thank you Dave, do you know how to do it with a relative address instead of absolute?. Regards. http://myurl.whatever/site/assets/data/myfile.txt does the job, but myfile.js and myfile.txt reside on the same processwire site so I would like to access with a relative path.
  16. How can I access the assets folder from a javascript file? from: /site/templates/js/myjs.js to: /assets/myfile.txt Best regards.
  17. Hello everybody. I have generated same json data following this link, and I would like to: Save it under myfile.json into the assets folder. Read it from javascript. It belongs to a project to get information about some monuments in a town (images, lat, lng, text, accesibility, etc) probably many people would use it at the same time. Information is static, it will be changed rarely, so I tought about generating the info about each monument in a single json file that way is no need to generate that information every time by the server or worrying about cache. After that a use jquerymobile and angularjs to read the json file and present it to a mobile device. I will appreciate any help. Regards.
  18. Hello. 1.- Has anybody try to develop a point of sale with processwire? 2.- I'm thinking about to start a simple POS with a responsive template so the client would be able to work from a Pda or smartphone as well as a desktop. 3.- Do you think a machine with linux/apache/processwire would fit for a commerce with thousands of products or should a rather use a different programming language? Thank you to everybody in advance.
  19. Great module, I'll give it a good use. Thank you for sharing Wanze.
  20. Hello. I make a use of $field->tags quite interesting in case is helpful for somebody else. The problem: I want to populate a page with data of several types, images, text, etc, some of this fields have to appear in a table and I like to automatize that from the backend, having the opportunity of ordering and selecting the items I want to appear on it. The solution: Give the items you want to appear on the table a tag of whatever ( a choose 'table' to be original ), then in the template you use to present the data, check if the field has the tag you have choosen, then present it on the table.
×
×
  • Create New...