I have noticed image-preview.html resides in (view->adminhtml->web->template) in magento 2 module. But i don't understand the code that are referenced within this html file. Here is the source of the image-preview.html file.
`
<div class="file-uploader-preview">
<a attr="href: $parent.getFilePreview($file)" target="_blank">
<img
class="preview-image"
tabindex="0"
event="load: $parent.onPreviewLoad.bind($parent)"
attr="
src: $parent.getFilePreview($file),
alt: $file.name">
</a>
<div class="actions">
<button
type="button"
class="action-remove"
data-role="delete-button"
attr="title: $t('Delete image')"
click="$parent.removeFile.bind($parent, $file)">
<span translate="'Delete image'"/>
</button>
</div>
</div>
<div class="file-uploader-filename" text="$file.name"/>
<div class="file-uploader-meta">
<text args="$file.previewWidth"/>x<text
args="$file.previewHeight"/>
</div>
`
Can someone explain this code to me, else provide what i need to learn to understand and modify this code in my custom magento 2 module as per my requirement.
Related
I am using laravel / lumen. I need to scrape a page, I am using the Goutte package. This is the HTML. This is the HTML of the page.
<div id="locationMessage">
<div>
<h4>
In order
</h4>
</div>
<div>
<button id="locationChinaNorth" type="button" class="btn">China (Chinese Mainland) - North</button>
</div>
<div>
<button id="locationChinaSouth" type="button" class="btn">China (Chinese Mainland) - South<br />Hong Kong SAR (China) / Taiwan (China)</button>
</div>
<div>
<button id="locationOther" type="button" class="btn">All other locations</button>
</div>
<div class="margin0">
<img src="/myMSC/Content/Images/download-mymsc-on-app-store.svg" alt="DOWNLOAD MYMSC ON APP STORE" />
<img src="/myMSC/Content/Images/download-on-google-play.png" alt="DOWNLOAD MYMSC ON GOOGLE PLAY" id="imgStoreGoogle" />
</div>
</div>
I just need to click the button with id = "locationOther", but I get errors using "link" and "selectButton" with no good results.
I hope someone can help me, thank you!
$buttonCrawler = $crawler->selectButton('Button text');
I am doing a small project with vue.js and laravel. I have a list of products, when I click on a specific product on "Quick view" button I want to show all data about that product in a modal but the data is not showing in the modal.
Can you help me please. Here is my code:
#extends('app')
#section('content')
<div id ="crud" class="row">
<div class="col-xs-12">
<h1 class="page-header">Lista de Articulo</h1>
</div>
<div class="wrap-icon right-section col-md-12" data-toggle="modal" data-target="#list" >
<div class="wrap-icon-section wishlist">
<a href="#" class="link-direction">
<i class="fa fa-heart" aria-hidden="true"></i>
<div class="left-info">
<span class="index">0 item</span>
<br>
<span class="title">Wishlist</span>
</div>
</a>
</div>
</div>
<div class="row">
<div v-for="keep in keeps" class="col-md-4" style="width:25%;" #mouseover="showByIndex = keep" #mouseout="showByIndex = null">
<div class="container">
<img :src="keep.foto" style="width:100%; max-width:150px;">
<button class="btn" v-show="showByIndex === keep" v-on:click.prevent="showKeep(keep)">Quick view</button>
</div>
<h3>
<b> #{{keep.nombre}}</b>
</h3>
<p> #{{keep.descripcion}}</p>
I fixed it. The error was because I called the modal file outside the div. Thanks to everybody.
you can't send data directly from vue in blade structure, you need to write a component for that.
https://v3.vuejs.org/examples/modal.html#modal-component
I am trying to image and its relevant data in bootstrap. For that I am writing code like below
<div class="col-xs-12 col-sm-3 col-sm-push-9">
<p style="padding:20px;"></p>
<h3 align=center>Our Lipsmacking Culinary Creations</h3>
</div>
<div class="col-xs-12 col-sm-9 col-sm-pull-3">
<div class="media">
<div class="media-left media-middle">
<a href="#">
<img class="media-object img-thumbnail" src="img/uthappizza.png" alt="Uthappiza">
</a>
<div class="media-body">
<h2 class="media-heading">Uthappizza</h2>
<p>A unique combination of Indian Uthappam (pancake) and
Italian pizza, topped with Cerignola olives, ripe vine
cherry tomatoes, Vidalia onion, Guntur chillies and
Buffalo Paneer.</p>
<p><a class="btn btn-primary btn-xs" href="#">More ยป</a></p>
</div>
</div>
</div>
</div>
I am getting output like this:
enter image description here
I want it to be side by side I don't know where I am going wrong.
Add pull-left to your image as a class. Bootply.
I am trying to override default header section of odoo 8 website with my own design but am getting errors when i use xpath expression and do a replace. See code below :
header.xml code
<template id="layout_replace_menu_header" customize_show="True" inherit_id="website.layout" name="custom_header_replace">
<xpath expr="//div[#class='navbar navbar-default navbar-static-top']" position="replace">
<header>
<div class="header">
<div class="container">
<a class="site-logo" href="#"><img src="/themeotb2/static/otbassets/img/logo.png" alt="image" /></a>
<i class="fa fa-bars"></i>
<!-- BEGIN NAVIGATION -->
<div class="header-navigation pull-right font-transform-inherit">
<ul>
<t t-foreach="website.menu_id.child_id" t-as="submenu">
<li class="dropdown">
<t t-call="website.submenu"/>
</li>
</t>
<!-- BEGIN TOP SEARCH -->
<li class="menu-search">
<span class="sep"></span>
<i class="fa fa-search search-btn"></i>
<div class="search-box">
<form action="#">
<div class="input-group">
<input type="text" placeholder="Search" class="form-control" />
<span class="input-group-btn">
<button class="btn btn-primary" type="submit">Search</button>
</span>
</div>
</form>
</div>
</li>
<!-- END TOP SEARCH -->
</ul>
</div>
<!-- END NAVIGATION -->
</div>
</div>
</header>
</xpath>
</template>
When i use "inside" instead of replace the code will execute but when i do replace odoo complains with errors:
File "/opt/openerp/ttfa/projectdatabase/src/openerp/models.py", line 1270, in _validate_fields
raise ValidationError('\n'.join(errors))
ParseError: "ValidateError
Field(s) `arch` failed against a constraint: Invalid view definition
Error details:
Element '<xpath expr="//header//a[#class='navbar-brand']">' cannot be located in parent view
Error context:
View `Show Logo`
How can i solve this? Thank you.
Either You have to override template "layout_logo_show" or disable "Show Logo" from website Customize setting.
Thank You!
So, I am building a web crawler for one site's comment section, and I have came with a problem, it seems I can't find a text node for the comments content. This is how the web pages element looks:
<div class="comments"> // this is the whole comments section
<div class="comment"> // this is where the p is located
<div class="comment-top">
<div class="comment-nr">208. PROTAS</div>
<div class="comment-info">
<div class="comment-time">2015-06-30 13:00</div>
<div class="comment-ip">IP: 178.250.32.165</div>
<div class="comment-vert1">
<a href="javascript:comr(24470645,'p')">
<img src="http://img.lrytas.lt/css2/img/com-good.jpg" alt="">
</a> <span id="cy_24470645"> </span>
</div>
<div class="comment-vert2">
<a href="javascript:comr(24470645,'m')">
<img src="http://img.lrytas.lt/css2/img/com-bad.jpg" alt="">
</a> <span id="cn_24470645"> </span>
</div>
</div>
</div>
<p class="text-13 no-intend">Test text</p> // I need to get this comments content
</div>
I tried a lot of xpath's like:
*/div[contains(#class, "comment")]/p/text()
/p[contains(#class, "text-13 no-intend")]/text()
etc.
But can't seem able to locate it.
Would appreciate any help.
How about this:
//div[#class = 'comments']/div[#class = 'comment'][1]/p/text()