Jump to content

siaweb

Members
  • Posts

    10
  • Joined

  • Last visited

Posts posted by siaweb

  1. 5 hours ago, Studio Lambelet said:

    Привет@siaweb,

    Доступны ли посетителям страницы селектора "имя_ассортимента.home_menu=1"?

    Вы пытались  включить include=all  в find()? Похоже на проблему контроля доступа:  https://processwire.com/docs/selectors/#access_control

    Я лично думаю, что было бы лучше разрешить доступ к страницам вместо использования include=all, но вы делаете ?

    Thank you really with include=all everything works and shows well.

    As for your first question, this page is available for viewing. I have a part of the assortment of the cafe displayed on the main page. The administrator puts a check mark that this element should be shown. That's all.

  2. Everything coped helped in another place a little. Thank you all.

    If someone needs a cheat sheet, then I pulled it all out. You can close the branch.

    Spoiler

    $hm_pages = $pages->find("assortment_name.home_menu=1");
                            if (!empty($hm_pages)) {
                                foreach ($hm_pages as $hm_page) {
                                    foreach ($hm_page->assortment_name as $an_item) {
                                        if ($an_item->home_menu) {
                            ?>
                                <li class="ct-foodMenu">
                                    <div class="ct-dottedBg"></div>
                                    <label class="ptn13 ct-u-font2"><?php echo $an_item->assortment_title; ?>
                                    <?php
                                    if ($an_item->assortment_icon->count > 0) {
                                        foreach ($an_item->assortment_icon as $icon) {
                                                 {  echo '<i class="' . $icon->title . '"></i>';}
                                        }
                                    }
                                    ?><?php $icons = $an_item->assortment_icon; include 'assets/theme/_icon_assortment.php';?>
                                    </label> 
                                    <span class="ptn13 ct-u-font1"><?php echo $an_item->assortment_price; ?></span>
                                    <div class="clearfix"></div>
                                    <div class="ct-u-foodIngredients"><?php echo $an_item->assortment_note; ?></div>
                                </li>
                            <?php

     

  3. Good afternoon, everyone. Faced with the problem of displaying data on the main page. I'm asking for help since I'm just at the beginning of learning CMS. I have.

    • 1. Home
    • 2 Menu
    •  2.1 breakfast
    •  2.2 Lunches
    •  2.3 Already.

    I need to take and items 2.1/2.2/2.3 the data from the assortment_name field is a Repeater. There are only 3 text fields. I don't know how to do it. Maybe someone will help.

    There are also checkbox fields. This is usually if it is output to the main page. The name of the home_menu checkbox.

    Spoiler

    assortment_name

    • assortment_title - TextLanguage
    • assortment_price - Text
    • assortment_note - TextLanguage
    • assortment_icon - Options
    • home_menu - Checkbox 

     

  4. On 5/20/2022 at 10:38 PM, kongondo said:

    Welcome to the forums @siaweb.

    hi @kongondoI dealt with my first question differently. Completely redesigned the menu for module requests. But I had a new question. I just can't redo the menu in my second project otherwise. The bottom line is that I use two classes for links example below.

    Spoiler

    <div class="menu-box my-scrollbar">
                    <div id="dl-menu" class="dl-menuwrapper">
                        <ul class="dl-menu dl-menuopen">
                            <li><a class="page-link" href="" data-hover="home">home</a></li>  
                            <li><a class="page-link" href="" data-hover="about me">about me</a></li> 
                            <!-- submenu / extra -->
                            <li class="submenu"><a href="#" data-hover="extra">extra</a>
                                <ul class="sub-menu">
                                    <li class="submenu "><a href="#" data-hover="elements">elements</a>
                                        <ul class="sub-menu">
                                            <li><a class="ajax-loader" href="elements-typography.html" data-hover="typography">typography</a></li>         
                                            <li><a class="ajax-loader" href="elements-social-icons.html" data-hover="social icons">social icons</a></li>
                                        </ul>
                                    </li>

                                    <li class="submenu"><a href="#" data-hover="portfolio">portfolio</a>
                                        <ul class="sub-menu">
                                            <li class="submenu"><a href="#" data-hover="grids">grids</a>
                                                <ul class="sub-menu">
                                                    <li><a class="ajax-loader" href="portfolio-grid-boxed-col2.html" data-hover="boxed col 2">boxed col 2</a></li>
                                                </ul>
                                            </li>
                                            <li class="submenu"><a href="#" data-hover="masonry">masonry</a>
                                                <ul class="sub-menu">
                                                    <li><a class="ajax-loader" href="portfolio-masonry-boxed-col2.html" data-hover="boxed col 2">boxed col 2</a></li>
                                                </ul>
                                            </li>
                                            <li class="submenu"><a href="#" data-hover="single">single</a>
                                                <ul class="sub-menu">
                                                    <li><a class="ajax-loader" href="portfolio-single1.html" data-hover="single 1">single 1</a></li>
                                                    <li><a class="ajax-loader" href="portfolio-single-video.html" data-hover="single video">single video</a></li>
                                                </ul>
                                            </li>
                                        </ul>
                                    </li>
                                    <li class="submenu "><a href="#" data-hover="pages">pages</a>
                                        <ul class="sub-menu">
                                           <li><a class="ajax-loader" href="about-me2.html" data-hover="about me v2">about me v2</a></li>
                                    <li><a class="ajax-loader" href="nofile.html" data-hover="error 404">error 404</a></li>
                                        </ul>
                                    </li>
                                    
                                </ul>
                            </li>
                        </ul>  
                    </div>  
                </div>

    My problem is in two classes that I won't be able to transfer. class="ajax-loader" class="page-link

  5. Hi @kongondo Help solve the blog problem. My blog shows from the first created post to the last one. And I need to always go from the last created to the past first. I can't figure out how to do it. Thanks.

  6. 15 hours ago, kongondo said:

    Welcome to the forums @siaweb.

    Do you mean each submenu to have a unique subclass? That is not possible using $menu->render(). Instead, I'd suggest getMenuItems(). Please see its documentation and examples here.

    Hello @Clarity,

    The menu name is automatically created from the menu title. It is not separately editable via Menu Builder (it's a page though). Could you please explain why you need access to the name?

    Good day. I'm not selenium in PHP to be honest. But from what you sent me for review, I have read.

    I can do this. 

    Rules: If the menu goes deeper than 1 level, then apply such a style. (But as far as I understood, the style will only apply to il and not to ul)

    Thanks for the reference, I will try to understand, but I realized for myself that it's easier for me to redo the CSS menu. Since it's easier for me than with PHP. 

    Thanks. But for the overall development, everything is exactly on the test server, then I will try to do it more correctly.

  7. Good day to everyone.

    Please tell me how to implement my menu with different menu subclasses?

    Here is the code of my old site menu. 

    	+'<nav class="mainNav">'
    		+'<div class="mobileMainNavBtn mainNav__btn">'
    			+'<span></span>'
    		+'</div>'
    		+'<ul class="mainNav__list">'
    			+'<li class="mainNav__item"><a href="/en/" class="mainNav__link" title="Hotel Prestige Center, St. Petersburg">Hotel</a>'
    				+'<ul class="mainNavDropdownL1 mainNav__dropdown">'
    					+'<li class="mainNavDropdownL1__item"> <a href="/about/contacts/" class="mainNavDropdownL1__link" title="Our contact">Our contact</a> 	</li>'
    					+'<li class="mainNavDropdownL1__item"> <a href="/about/rekviziti/" class="mainNavDropdownL1__link" title="Payment details">Payment details</a> </li>'
    					+'<!--<li class="mainNavDropdownL1__item"> <a href="/about/3stars/" class="mainNavDropdownL1__link" title="Hotel certificate">Hotel certificate</a> 	</li>-->'
    				+'</ul>'
    			+'</li>'
    			+'<li class="mainNav__item"><a href="https://pre-apart.ru/" class="mainNav__link" title="kitchen">Kitchen</a></li>'
    			+'<li class="mainNav__item">'
    			+'<a href="/en/nomera/" class="mainNav__link" title="Hotel room">Rooms</a>'
    				+'<ul class="mainNavDropdownL1 mainNav__dropdown mainNav__dropdown--row">'
    					+'<li class="mainNavDropdownL1__item">'
    					+'<a href="/en/nomera/cat1/" class="mainNavDropdownL1__link" title="">The rooms of the first category</a>'
    						+'<ul class="mainNavDropdownL2 mainNavDropdownL1__dropdown">'
    							+'<li class="mainNavDropdownL2__item"><a href="/en/nomera/cat1/mini/" class="mainNavDropdownL2__link" title="Mini Room">«Mini»</a></li>'
    							+'<li class="mainNavDropdownL2__item"><a href="/en/nomera/cat1/econom/" class="mainNavDropdownL2__link" title="Room I category Economy">«Economy»</a></li>'
    							+'<li class="mainNavDropdownL2__item"><a href="/en/nomera/cat1/standart/" class="mainNavDropdownL2__link" title="Category I room Standard">«Standard»</a></li>'
    							+'<li class="mainNavDropdownL2__item"><a href="/en/nomera/cat1/comfort/" class="mainNavDropdownL2__link" title="The I-Comfort category">«Comfort»</a></li>'
    							+'<li class="mainNavDropdownL2__item"><a href="/en/nomera/cat1/comfort+/" class="mainNavDropdownL2__link" title="The I-Comfort category">«Comfort +»</a></li>'
    						+'</ul>'
    					+'</li>'
    					+'<li class="mainNavDropdownL1__item"><a href="/en/nomera/cathigh/" class="mainNavDropdownL1__link" title="">Rooms of the highest category</a>'
    						+'<ul class="mainNavDropdownL2 mainNavDropdownL1__dropdown">'
    							
    							+'<li class="mainNavDropdownL2__item"><a href="/en/nomera/cathigh/deluxe/" class="mainNavDropdownL2__link" title="Superior Junior Suite with Jacuzzi">«Junior Suite»</a></li>'
    							+'<li class="mainNavDropdownL2__item"><a href="/en/nomera/cathigh/luxe/" class="mainNavDropdownL2__link" title="Suite of the highest category Two-room Suite">«Lux»</a></li>'
    							+'<li class="mainNavDropdownL2__item"><a href="/en/nomera/cathigh/apartment/" class="mainNavDropdownL2__link" title="Superior room Apartment with Jacuzzi">«Apartment»</a></li>'
    						+'</ul>'
    					+'</li>'
    					+'<li class="mainNavDropdownL1__item"><a href="https://pre-apart.ru/en/rooms-suites/" class="mainNavDropdownL1__link" title="">Room with kitchen</a>'
    						+'<ul class="mainNavDropdownL2 mainNavDropdownL1__dropdown">'
    							+'<!--<li class="mainNavDropdownL2__item"><a href="/en/nomera/kitchen/13A/" class="mainNavDropdownL2__link" title="Room with kitchen 13A">«Room with kitchen 13A»</a></li>-->'
    							+'<!--<li class="mainNavDropdownL2__item"><a href="/en/nomera/kitchen/13B/" class="mainNavDropdownL2__link" title="Room with kitchen 13B">«Apartment 13B»</a></li>-->'
    							+'<!--<li class="mainNavDropdownL2__item"><a href="/en/nomera/kitchen/11/" class="mainNavDropdownL2__link" title="Marine 11">«Marine 11»</a></li>-->'
    							+'<!--<li class="mainNavDropdownL2__item"><a href="/en/nomera/kitchen/12/" class="mainNavDropdownL2__link" title="Marine 12">«Marine 12»</a></li>-->'
    							+'<!--<li class="mainNavDropdownL2__item"><a href="/en/nomera/cathigh/studio/" class="mainNavDropdownL2__link" title="Room of the highest category Studio">«Studio»</a></li>-->'
    						+'</ul>'
    					+'</li>'
    					+'<li class="mainNavDropdownL1__item"><a href="/tseni/" class="mainNavDropdownL1__link" title="Prices for Rooms hotels">Hotel price</a>'
    						+'<ul class="mainNavDropdownL2 mainNavDropdownL1__dropdown">'
    						+'<li class="mainNavDropdownL2__item"><a href="/gallery/" class="mainNavDropdownL2__link" title="Hotel gallery">«Hotel gallery»</a></li>'
    						+'</ul>'
    					+'</li>'
    				+'</ul>'
    			+'</li>'
    
    			+'<li class="mainNav__item"><a href="/skidki/" class="mainNav__link" title="Hotel cheaper: discounts and special offers to hotel guests">Discounts</a></li>'
    			+'<li class="mainNav__item"><a href="/uslugi/" class="mainNav__link" title="Breakfast, lunch, dinner">Service</a>'
    				+'<ul class="mainNavDropdownL1 mainNav__dropdown">'
    					+'<!--<li class="mainNavDropdownL1__item"><a href="/uslugi/transfer/" class="mainNavDropdownL1__link" title="Трансфер">Трансфер до/из отеля</a></li>-->'
    					+'<li class="mainNavDropdownL1__item"><a href="/uslugi/voucher/" class="mainNavDropdownL1__link" title="Visa support">Visa support</a></li>'
    					+'<li class="mainNavDropdownL1__item"><a href="/cafe/" class="mainNavDropdownL1__link" title="Russian cuisine restaurant of the hotel">Breakfast and dinner</a></li>'
    				+'</ul>'
    			+'</li>'
    			+'<li class="mainNav__item"><a href="/raspolozenie/" class="mainNav__link" title="Location on the map">Location</a>'
    				+'<ul class="mainNavDropdownL1 mainNav__dropdown">'
    					+'<li class="mainNavDropdownL1__item"><a href="/raspolozenie/" class="mainNavDropdownL1__link" title="Hotel location on the map of St. Petersburg">Hotel on the map</a></li>'
    					+'<li class="mainNavDropdownL1__item"><a href="/raspolozenie/dobratsya/" class="mainNavDropdownL1__link" title="How to get to the hotel in St. Petersburg">How to get</a></li>'
    				+'</ul>'
    			+'</li>'
    			+'<li class="mainNav__item"><a href="/en/bronirovanie/" class="mainNav__link" title="Quick booking of rooms">Booking</a>'
    				+'<ul class="mainNavDropdownL1 mainNav__dropdown">'
    					+'<li class="mainNavDropdownL1__item"><a href="/en/bronirovanie/" class="mainNavDropdownL1__link" title="Book a hotel room">Booking a room!</a></li>'
    					+'<li class="mainNavDropdownL1__item"><a href="/en/tseni/oplata/uniteller/" class="mainNavDropdownL1__link" title="Card payment online">Card payment online</a></li>'
    					+'<li class="mainNavDropdownL1__item"><a href="/en/tseni/oplata/uniteller/emoney.php" class="mainNavDropdownL1__link" title="Payment by e-money Ya. Money, WebMoney, QIWI">Payment from e-wallets</a></li>'
    					+'<li class="mainNavDropdownL1__item"><a href="/en/tseni/oplata/sberbank/" class="mainNavDropdownL1__link" title="Payment through Sberbank">Payment through Sberbank</a></li>'
    					+'<li class="mainNavDropdownL1__item"><a href="/en/tseni/oplata/platezka/" class="mainNavDropdownL1__link" title="Payment by Bank transfer">Payment by Bank transfer</a></li>'
    					+'<li class="mainNavDropdownL1__item"><a href="/en/tseni/oplata/creditcard/" class="mainNavDropdownL1__link" title="Card payment off-line">Card payment off-line</a></li>'
    					+'<li class="mainNavDropdownL1__item"><a href="/en/tseni/oplata/vozvrat/" class="mainNavDropdownL1__link" title="Chargeback">Chargeback</a></li>'
    					+'<li class="mainNavDropdownL1__item"><a href="/en/about/offero/" class="mainNavDropdownL1__link" title="Public offer">Public offer</a></li>'
    				+'</ul>'
    			+'</li>'
    			+'<li class="mainNav__item"><a href="/contacts/" class="mainNav__link" title="Contacts">Contacts</a></li>'
    				+'</ul>'	
    		+'</nav>'

    That's what I've already done.

    <nav class="mainNav">
    <?php
    			// load the module
    			$menu = $modules->get('MarkupMenuBuilder');// $menu is an example
    
    			
    
    			$options = array(
    			'wrapper_list_type' => 'ul',// ul, ol, nav, div, etc.
    			'' => 'li',// li, a, span, etc.
    			'' => 'main',// a CSS ID for the menu
    			'menu_css_class' => 'mainNav__list',// a CSS Class for the menu
    			'submenu_css_class' => 'mainNavDropdownL1 mainNav__dropdown',// CSS Class for sub-menus
    			'has_children_class' => 'mainNav__item',// CSS Class for any menu item that has children
    			);
    			
    			echo $menu->render ('main', $options);// render the menu by title		
    
    		?>
    </nav>

    If this is not possible, please also write, then I will redo the CSS of the old menu.

    Thanks.

  8. Hello everyone. I would like to add yandex services to tracking. Can you tell me how to add a couple of fields correctly?

    1. <!-- Yandex.Metrika counter -->

    <script type="text/javascript" > (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date();k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym(XXXXXXXX, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true, webvisor:true }); </script> <noscript><div><img src="https://mc.yandex.ru/watch/XXXXXXXXX" style="position:absolute; left:-9999px;" alt="" /></div></noscript>

    <!-- /Yandex.Metrika counter -->

    and

    <meta name="yandex-verification" content="xxxxxxxxxxxxxxxxxxx" />

×
×
  • Create New...