Jump to content

mrkhan

Members
  • Posts

    89
  • Joined

  • Last visited

Everything posted by mrkhan

  1. Hello LostKobrakai, my folder structure is like this htdocs ⌊ site-web1 ⌊ site-web2 ⌊ wp ⌊ wire what will be my in my index.config.php Thanks
  2. Hello LostKobrakai, its still not working. as write above let me explain again i have localhost and i have one website running on http://localhost/pw now i create one more directory in XAMP name web1 and my website path is: http://localhost/web1 i have copied SITE directory to web1 and rename to site-web1 and put and copy index.config.php in root folder of web1 and these are lines in my index.config.php 'localhost/web1/' => 'site-web1', 'www.mydomain.com' => 'site-mydomain', 'dev.mydomain.com' => 'site-dev', 'www.otherdomain.com' => 'site-other',
  3. Hello Soma, thanks for reply but after 1 week of struggling and searching doing all i can but i am unable to run multi site. i have sites on local host and web server, i want to test it first on localhost then web server. what i can't understand is in index.config.php this is line to change 'mydomain.com' => 'site-mydomain', how i like localhost in index.config.php to mydomain.com as its local host not .com ? and in web server how i put my domain directory to "site-mydomain" some thing starting with site ? let me explain you what i did 1. i have running PW website in localhost directory "PW" 2. i copy its DB with phpmyadmin to new DB name "web1" 3. i create a new directory in localhost name "web1" 4. i copy all "site" ".gitignore" ".htaccess" , "index.php" to web1 4. i configure "site/config.php" to new web1 DB 5. copy "index.config.php" to web1 root folder 6. now change " 'mydomain.com' => 'site-mydomain'," to "'http://localhost/web1/' => 'web1'," can you please help me how can i do this ?
  4. Oh Perfect it works fine now , here is code & module 1. use the latest version of PW 2. create a folder name "RemoveDeleteTab" in your site/modules/RemoveDeleteTab 3. create a module file "RemoveDeleteTab.module" in site/modules/RemoveDeleteTab 4. bellow is code for module and it will work perfect, enjoy <?php class RemoveDeleteTab extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'RemoveDeleteTab', 'version' => 1, 'summary' => 'Remove Delete Tabs for Some Users & Some Templates', 'singular' => true, 'autoload' => true, 'icon' => 'smile-o', ); } public function init() { // Remove Settings Tab in Global settings for non super admins $this->addHookAfter('ProcessPageEdit::buildForm', $this, "afterRemoveDeleteTab"); } public function afterRemoveDeleteTab(HookEvent $event){ // check what role the user has, if superuser do nothing if($this->user->isSuperuser()) return; $page = $event->object->getPage(); /// products is a template name , you can use your own template name here if($page->template->name === "products"){ $form = $event->return; //remove settings tab $fieldset = $form->find("id=ProcessPageEditSettings")->first(); $form->remove($fieldset); $event->object->removeTab("ProcessPageEditSettings"); //remove delete tab $fieldset = $form->find("id=ProcessPageEditDelete")->first(); $form->remove($fieldset); $event->object->removeTab("ProcessPageEditDelete"); $event->return = $form; } } } now Install the Module and it will work. thanks to @LostKobrakai and @Martijn Geerts
  5. Hello i find the new DEV version i got it working when i rename the function to public function afterRemoveDeleteTab(HookEvent $event){ and also change this function too public function init() { // Remove Settings Tab in Global settings for non superadmins $this->addHookAfter('ProcessPageEdit::buildForm', $this, "afterRemoveDeleteTab"); } as @Martijn Geerts suggested Thanks @Martijn Geerts But how to hide SETTINGS and Delete tabs for some Templates not all ? once its done i will share all module with every one as i think most of users need this option in admin. Thanks
  6. Hello LostKobrakai, can you please tell me what is current development version ? as i can get is 2.5.2, what is current development version and how to get it, if you please share the link? @Martijn Geerts i also try to rename the removeDeleteTab method to afterRemoveDeleteTab but it did't work... Thanks
  7. let me explain you what i did and what is error , i have downloaded new version of PW 2.5 and install it. it was working perfect. 1. create a new folder name "RemoveDeleteTab" in site ->module directory 2. create a file "RemoveDeleteTab.module" 3. put you code in "RemoveDeleteTab.module" file and when i goto admin and try to install this module i got bellow error Recoverable Fatal Error: Argument 1 passed to RemoveDeleteTab::removeDeleteTab() must be an instance of HookEvent, none given, called in /Applications/XAMPP/xamppfiles/htdocs/web1/wire/core/Modules.php on line 316 and defined (line 23 of /Applications/XAMPP/xamppfiles/htdocs/web1/site/modules/RemoveDeleteTab/RemoveDeleteTab.module) This error message was shown because you are logged in as a Superuser. Error has been logged.
  8. Hello when i use your module i got following error Error: Class 'RemoveDeleteTab' not found (line 316 of /Applications/XAMPP/xamppfiles/htdocs/web1/wire/core/Modules.php) This error message was shown because you are logged in as a Superuser. Error has been logged. i have downloaded current PW 2.5 and its still same.
  9. hello Soma, i really don't understand how to do that, i am trying this from 2 days but no success i have one main domain where i want to place wire directory so that every time i just update one directory and all websites are updated. for example, my main domain is 1. abc1.com in this domain i have wire directory. now i have three other domains using wire CMS etc 1. abc2.com 2. abc3.net 3. xyz1.org now what i have site directory in these domains public_html folder. now which file i place in which domain public_html and what path i should set. also can these domains be on same server or it can be on different servers? Thanks
  10. Hello LostKobrakai, thanks for your reply and i totally understand. but the only issue i am getting now is how to use AJAX to save page to page field. i am trying but its not working. can you help me some little code for link or button to use AJAX to save that page ID in pagefield of user profile? Thanks
  11. Hello, i have managed to login and logout and change password for user from PW front end with the help of https://processwire.com/talk/topic/1716-integrating-a-member-visitor-login-form/ many thanks to @ryan but now i need it little advance 1. i want to have option for login users to save some pages as FAV and can see in their profile. how exactly i can do that ? do i need to create some fields in users Template , how login users can press button on page to put as FAV & if he is not logged in it goto LOGIN Page. 2. and User Name and Phone Number and Pic in user profile. Thanks
  12. Hello, i read all topics but nothing is working, i want to know if some one have done this.
  13. Hello, i have completed my first project in PW and its really great. i have few user groups and i want to give delete page options for each group on Template basis. i don't want to give all templates delete options to some group but want to hide Delete tab for some templates and show delete tab for some templates. like if i have two templates 1. products 2. product i want that user can see delete tab on product template but not on products template. how can i do that ? Thanks
  14. Hello diogo, thanks for your reply and link, i read that page many times but really can't understand, like rename the directory to site-something why as all domains will have its own PUBLIC_HTML directory. let me explain you here little bit more. what i am looking for is websites with different databases but using same wire directory. like i have four domains 1. abc1.com 2. abc2.com 3. abc3.com 4. abc3.com so i want to put wire folder in abc1.com PUBLIC_HTML folder and put SITE folder in PUBLIC_HTML of all three other domains, now what configuration i need on abc2.com and abc3.com etc to access wire folder from abc1.com assuming all 4 domains are on one server. Thanks
  15. Thanks every one for replying so quickly, this is Fantastic and thanks to teppo for warning this is getting more interested. i want to know is there a way to have one "wire" directory and run multiple websites ? like one "wire" directory on some main server and only "site" directory in website "public_html" is this possible ? Thanks
  16. Hello Joss, i know all this and as i said earlier thats why i love PW, but m question is still same, is there way to rename the "Wire" directory or not? i don't want to change just for my information and trying that's it. Thanks
  17. Hello Joss, Actually i am leaning PW and i really love it, its really vary nice CMS and great options and i love the way how it handle every thing as page and how it create tables etc. i want to see all what can i do with this and till what extent i can customize. like in WP, we can rename any folder we want for security and other things, thats why i want to know can we rename PW folder to some other name or not ? Thanks
  18. Hello I am wondering is this possible to rename the main "wire" directory to some other name ? if yes, can i have some help. Thanks
  19. Hello @netcarver thanks for reply but none of your solution is working. as my website is using templetes with head.inc in top, i have added $temp = $page->template; $temp->set('noSettings', 1); $temp->save(); also your second solution is not working too. in head.inc of site template, but in admin when i goto to edit any page, i can still see the settings tab. on this link https://processwire.com/talk/topic/4680-block-access-to-settings-delete-and-view-tabs-for-page/#entry83981 provided by @LostKobrakai i got this code // in a autoload module like HelloWorld.module public function init(){ $this->addHookAfter("ProcessPageEdit::buildForm", $this, "buildFormHook"); } public function buildFormHook(HookEvent $event){ // get page edited by ProcessPageEdit $page = $event->object->getPage(); // conditions if(wire("user")->hasRole("superuser")) return; if($page->id == 1039) { // the form InputfieldWrapper returned by ProcessPageEdit::buildForm() $form = $event->return; // find the desired InputfieldWrapper's and remove them from the form $fieldset = $form->find("id=ProcessPageEditSettings")->first(); $form->remove($fieldset); $fieldset = $form->find("id=ProcessPageEditDelete")->first(); $form->remove($fieldset); } } and when i create new controller and install that controller, it shows settings tab but when i click nothing happen, settings tab is gone but still i can see settings tab button, how can i also hide that button? Thanks
  20. Hello, i am using version 2.5 of PW and trying to hide settings tab on user role webmaster (which is my defied role) i have use bellow code <?php class AdminHelperHooks extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'My Admin Helper Hooks', 'version' => 1, 'singular' => true, 'autoload' => true ); } public function init() { // add hook to the page edit module and the method that creates the wanted fieldset $this->addHookAfter('ProcessPageEdit::buildFormRoles', $this, "removeSettings"); } function removeSettings(HookEvent $event){ // check what role the user has, if not has editor role do nothing if(!wire("user")->hasRole("webmaster")) return; // $event->return being the inputfield wrapper $wrapper = $event->return; // set the inputfield wrapper to hidden $wrapper->collapsed = Inputfield::collapsedHidden; // we're done } } in site/modules/AdminHelperHooks/AdminHelperHooks.module also i install the module but when i login as user using webmaster group i can see settings tab. how i hide page setting tab for this type of user ? Thanks
  21. Hello Soma, i am using version 2.5 of PW and trying to hide settings tab on user role webmaster (which is my defied role) i have use bellow code <?php class AdminHelperHooks extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'My Admin Helper Hooks', 'version' => 1, 'singular' => true, 'autoload' => true ); } public function init() { // add hook to the page edit module and the method that creates the wanted fieldset $this->addHookAfter('ProcessPageEdit::buildFormRoles', $this, "removeSettings"); } function removeSettings(HookEvent $event){ // check what role the user has, if not has editor role do nothing if(!wire("user")->hasRole("webmaster")) return; // $event->return being the inputfield wrapper $wrapper = $event->return; // set the inputfield wrapper to hidden $wrapper->collapsed = Inputfield::collapsedHidden; // we're done } } in site/modules/AdminHelperHooks/AdminHelperHooks.module also i install the module but when i login as user using webmaster group i can see settings tab. how i hide page setting tab for this type of user ? Thanks
  22. Hello SteveB, thanks for reply, as you see my HTML code above how many functions i need and then how to call them in loop ? see my HTML in this <div class="item active"> will have 4 <div class="span3 product-block"> after 4 again <div class="item "> will repeat but with out active and this will react for every 4 products from loop. <div class="item active"> <div class="row-fluid box-product"> <div class="span3 product-block"><div class="product-inner"> <div class="image"> <a href="#"><img alt="Loves or pursues" src="products/image-4.jpg"></a> </div> <div class="wrap-infor"> <div class="name"><a href="#">Loves or pursues</a></div> <div class="description">Samsung Galaxy Tab 10.1, is the world's thinnest tablet, m...</div> </div> </div> </div> </div> </div> i really can't figure out how to do this in functions also, like how to call functions in PW pages loop etc. some code will be really help full. Thanks
  23. hello adrian, thanks for quick reply, how can i break loop or print "product_type" only once. Thanks
  24. i have one product Template with following fields title product_name product_image product_type desc in my Template file i am using this code to get products $sid=$pages->find("template=product"); foreach($sid as $product){ { echo $product->product_name ."<br>"; echo $product->product_image->url ."<br>"; echo $product->desc ."<br>"; } this is working fine but i want to sort the products with product_type and display as bellow product_type 1 --- product_name --- product_image->url --- desc product_type 2 --- product_name --- product_image->url --- desc product_type 3 --- product_name --- product_image->url --- desc i hope i am able to explain how i need as output , can't really figure out how to do it in PW. Thanks
×
×
  • Create New...