Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: homepage not working (backport #38755) #38756

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions erpnext/portal/doctype/homepage/homepage.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@
// For license information, please see license.txt

frappe.ui.form.on('Homepage', {
setup: function(frm) {
frm.fields_dict["products"].grid.get_field("item").get_query = function() {
return {
filters: {'published': 1}
}
}
},

refresh: function(frm) {
frm.add_custom_button(__('Set Meta Tags'), () => {
frappe.utils.set_meta_tag('home');
Expand Down
20 changes: 20 additions & 0 deletions erpnext/templates/pages/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,26 @@ <h3 class="d-block d-sm-none">{{ homepage.description }}</h3>
{{ render_homepage_section(homepage.hero_section_doc) }}
{% endif %}

{% if homepage.products %}
<section class="container section-products my-5">
<h3>{{ _('Products') }}</h3>

<div class="row">
{% for item in homepage.products %}
<div class="col-md-4 mb-4">
<div class="card h-100 justify-content-between">
<img class="card-img-top website-image-extra-large" src="{{ item.image }}" loading="lazy" alt="{{ item.item_name }}"></img>
<div class="card-body flex-grow-0">
<h5 class="card-title">{{ item.item_name }}</h5>
<a href="{{ item.route }}" class="card-link">{{ _('More details') }}</a>
</div>
</div>
</div>
{% endfor %}
</div>
</section>
{% endif %}

{% if blogs %}
<section class="container my-5">
<h3>{{ _('Publications') }}</h3>
Expand Down