Jump to content

zaib

Members
  • Posts

    25
  • Joined

  • Last visited

Everything posted by zaib

  1. I've a json file, and from json file I'm creating some dynamic pages, problem is how i can edit language field or how to add new filed through API I'm doing like this <?php $string = file_get_contents('incl/codes.json'); $json_a = json_decode($string, true); $arabic = $languages->get("Arabic"); $page->of(false); foreach($json_a as $code){ $p = new Page(); // create new page object $p->template = 'city_code'; // set template $p->parent = wire('pages')->get('/master_data/city_codes'); // set the parent $p->name = $code["CITY_CODE"]; // give it a name used in the url for the page $p->title = $code["CITY_CODE"]; // set page title (not neccessary but recommended) $p->title->setLanguageValue($arabic, $code["CITY_AR"]); $p->save(); } ?>
  2. @dragan how can i create 6k pages with AP, is there any processwire module ? can you help me in this. thank you.
  3. @Tom. yes more than 6000, basically i'm select option is holding all airport city code like 'LHR,DXB,LAX etc..'. for page references do i need to create 6000 pages?
  4. I'm trying to save a select field with single select option but after clicking on save button i got error page, data in select options is more than 6000
  5. Hi, is there any module which can perform relational drop down, for example I've one drop down which is containing all countries if i select "UAE" the next drop down value will be change on the basis of selected counties and second dropdown will show all cities belongs to "UAE" Thank you.
  6. @cstevensjr Yes same template, and there isn't any field have their own permissions, only seo tab fields are there (MarkSEO) Processwire version is 3.0.62 PHP version is 7.0.22-Obuntu0.17.04.1 MacOS Seirra 10.12.6
  7. In PW I created a user 'tester' and gave the access to create edit and new. Issue is I'm unable to see 'edit' link in front of each page link and pages that i want to edit is already created. any help in this will be great help. Thank you.
  8. I've a simple scenario, i want to add two users "content_creator" & "content_publisher" content_creator can add new pages,edit them(only edit not publish) and view only where content_publisher can publish the unpublished pages after reviewing. Thank you.
  9. I've two templates, one is category (multi select check boxes) and one is result based on the selected category when I'm rendering result page all result is showing in every category, its not filtered each result should be belongs to the referenced category <?php $getCities = $pages->find("template=t3Cities_list, tags={$page->tag_code}, sort=title"); $getResult = $pages->find("template=attractions, tags={$page->tag_code}, sort=random"); ?> <div class="container"> <?php foreach($getCities as $city){ echo "<div class='row'>"; echo $city->title ; echo "</div>"; foreach($getResult as $result){ echo $result->title ; } } ?> </div> result should be like this Birmingham Oxford Street Louvre and Tuileries Dubai Gold Souk Dubai Mall paris Mercado de Motores Nómada Market
  10. My web app is done, and ready for production, how can i take my all data to production what are the best practices. I was exporting my "Fields" and importing into my production website but it says "Request Entity Too Large The requested resource /processwire/setup/field/import/ does not allow request data with POST requests, or the amount of data provided in the request exceeds the capacity limit. Apache/2.4.18 (Ubuntu) Server at 52.18.55.209 Port 80" This is my server limitations or what i don't know, or suggest me how to do that.
  11. I'm fetching some results on the basis of categories check boxes (which are checked only). until here works fine, issue is if multiple check boxes are selected so given result is also duplicating <?php $getCities = $page->find("template=t3Cities_list"); foreach ($getCities as $city) { foreach ($city->tags as $get) { $getTags = $page->get("template=tags_template, include=hidden")->children("sort=title, tag_code={$get->title}"); echo "<div class='grid-masonry'><div class='grid-sizer'></div>"; foreach ($getTags as $tag) { echo "<div class='grid-item'> <a href='{$tag->url}' class='img-hovered'> <div class='overlay'> <span>{$tag->title}</span> <!--<div class='cat-subtitle'>{$tag->categorymeta}</div> --> </div> <img class='img-responsive' src='{$tag->categorythumb->url}{$tag->categorythumb}' /> </a> </div>"; } echo "</div>"; } } ?> $getTags = $page->get("template=tags_template, include=hidden")->children("sort=title, tag_code={$get->title}"); this {$get->title} is the value of checkbox
  12. I'm fetching results from a template which works fine but when i change the language (in my case changed language is ARABIC), its showing me nothing $getResult = $pages->find("template=t3Cities_list, tags={$page->title}"); where "tags" are checkboxes with multi selection, How i can match the values?
  13. i added this parameter, working now JSON_UNESCAPED_SLASHES file_put_contents('posts.json', json_encode($json, JSON_UNESCAPED_SLASHES));
  14. @BitPoet Thank you for you quick reply, but see the output now after putting httpUrl { "title":"food and drink", "tag_url":"http:\/\/10.50.200.58\/en\/discover\/food-and-drink\/", "tag_img":null }, link is not formatted
  15. I've a template which basically consists of some fields (imgs,urls etc..). after loading page all data is coming and showing in "posts.json" file which is perfect, issue is title link and and image link is not in the format this is my json code for exporting the page data $getTags = $page->get("template=tags_template, include=hidden")->children("sort=title"); $json = array(); foreach($getTags as $tag){ $json[] = array( 'title' => $tag->title, 'tag_url' => $tag->url, 'tag_img' => $tag->categorythumb->url ); } file_put_contents('posts.json', json_encode($json)); and this is what i'm getting in .json file { "title":"food and drink", "tag_url":"\/en\/discover\/food-and-drink\/", "tag_img":"\/site\/assets\/files\/1471\/" }, see the output , title is fine. But links are not formatted should be like this http://10.50.200.58/en/discover/food-and-drink/ http://10.50.200.58/site/assets/files/1471/food-drink.jpg Any help would be appreciated. Thank you.
  16. I've a promotion page that i want to show on scheduler bases, Lets say i want my page "XYZ" should publish on Thu, 18 at 12:00am and unpublished on Web, 25 at 12:00am. is it possible in processwire?
  17. @BitPoet Thank you my friend, it's working. Appreciated
  18. I'm filtering result on the basis of multi select, see the code <div class="col-xs-12 col-sm-9"> <div class="tab-content"> <?php foreach($page->continents_1 as $continent){ $test = str_replace(' ', '', $continent->title); $get_countries = $page->find("template=t2Country, continents={$continent->title} "); foreach($get_countries as $country){ echo "<div class='$test tab-pane' id='$test'><span>$country->title</span></div>"; } } ?> </div> </div> if you see the image Europe is showing only "France" while if you see the developer tool img europe has more than one countries so it should be shown as Europe=>France,Spain,London, All data is coming but something wrong while filtering I'm mapping two fileds "Continents" and "countries" Any help would be appreciated. Thank you.
  19. I've a page "blog" which have child pages (blog posts). Right now I've 11 pages (blog posts) and I'm fetching all the posts in my "blog" pages which displaying fine, Issue is only 10 results are showing this is how I'm fetching $entries = $pages->find("template=blog-entry"); foreach($entries as $entry){ <a href='{$entry->url}'>$entry->title</a> }
  20. @szabesz thanx for your reply. look at the screenshot you can see there are some post title where arrows are pointing them there will be a page which contains all the details means details page. My question is how to create url for these titles which will open a page contains all the details.
  21. I'm using repeater field which contains a title which is clickable, Now there are lots of results like blog posts, I want when i click on title it should take me to the details page for the clicked title, i want to make it dynamic. Thank you.
  22. Thank you for your reply, I'm creating new Arabic language 'Ar' and in the the template fields i'm translating the text into Arabic as well, still I'm unable to see the change. This is my language change code foreach($languages as $language) { // if user is already viewing the page in this language, skip it if($language->id == $savedLanguage->id) continue; // if this page isn't viewable (active) for the language, skip it if(!$page->viewable($language)) continue; // set the user's language, so that the $page->url and any other // fields we access from it will be reflective of the $language $user->language = $language; // output a link to this page in the other language echo "<li><a href='$page->url'>$language->title: $page->title</a></li>"; } // restore the original language setting $user->language = $savedLanguage; ?> In the output 'Ar' is showing but when i click on language it redirects me to the home page only like language url should be like this www.website.com/ar. Or how to create new language which doesn't exits in PW pre installed languages. Any help will be a great help for me. Thank you.
  23. I'm creating a website, which has Arabic Language, How can i create Arabic language in PW.
×
×
  • Create New...