Why does empty @Html.Sitecore().Placeholder(“main”) generate ?
I am working with SXA 1.8 on Sitecore 9.0 update 2. Since Bootstrap 4 is being selected for the current site, ~/Views/SxaLayout/Bootstrap4Body.cshtml
view is being used. This view has such a code:
<main>
<div id="content" class="@Html.Sxa().GridPlaceholderClasses("main")">
@Html.Sitecore().Placeholder("main")
</div>
</main>
(I definitely know that particular view is being used since it hits in debugger), but having no components assigned into itself, it rendered with:
<main>
<div id="content" class="container">
<div class="row"></div>
</div>
</main>
Thus there is a question: where does <div class="row"></div>
come from and should not be it empty?
sxa placeholders
add a comment |
I am working with SXA 1.8 on Sitecore 9.0 update 2. Since Bootstrap 4 is being selected for the current site, ~/Views/SxaLayout/Bootstrap4Body.cshtml
view is being used. This view has such a code:
<main>
<div id="content" class="@Html.Sxa().GridPlaceholderClasses("main")">
@Html.Sitecore().Placeholder("main")
</div>
</main>
(I definitely know that particular view is being used since it hits in debugger), but having no components assigned into itself, it rendered with:
<main>
<div id="content" class="container">
<div class="row"></div>
</div>
</main>
Thus there is a question: where does <div class="row"></div>
come from and should not be it empty?
sxa placeholders
What do you have if you remove the placeholder code line and reload?
– Hugo Santos
8 hours ago
add a comment |
I am working with SXA 1.8 on Sitecore 9.0 update 2. Since Bootstrap 4 is being selected for the current site, ~/Views/SxaLayout/Bootstrap4Body.cshtml
view is being used. This view has such a code:
<main>
<div id="content" class="@Html.Sxa().GridPlaceholderClasses("main")">
@Html.Sitecore().Placeholder("main")
</div>
</main>
(I definitely know that particular view is being used since it hits in debugger), but having no components assigned into itself, it rendered with:
<main>
<div id="content" class="container">
<div class="row"></div>
</div>
</main>
Thus there is a question: where does <div class="row"></div>
come from and should not be it empty?
sxa placeholders
I am working with SXA 1.8 on Sitecore 9.0 update 2. Since Bootstrap 4 is being selected for the current site, ~/Views/SxaLayout/Bootstrap4Body.cshtml
view is being used. This view has such a code:
<main>
<div id="content" class="@Html.Sxa().GridPlaceholderClasses("main")">
@Html.Sitecore().Placeholder("main")
</div>
</main>
(I definitely know that particular view is being used since it hits in debugger), but having no components assigned into itself, it rendered with:
<main>
<div id="content" class="container">
<div class="row"></div>
</div>
</main>
Thus there is a question: where does <div class="row"></div>
come from and should not be it empty?
sxa placeholders
sxa placeholders
edited 8 hours ago
Richard Seal♦
13.8k32561
13.8k32561
asked 9 hours ago
Martin MilesMartin Miles
1285
1285
What do you have if you remove the placeholder code line and reload?
– Hugo Santos
8 hours ago
add a comment |
What do you have if you remove the placeholder code line and reload?
– Hugo Santos
8 hours ago
What do you have if you remove the placeholder code line and reload?
– Hugo Santos
8 hours ago
What do you have if you remove the placeholder code line and reload?
– Hugo Santos
8 hours ago
add a comment |
2 Answers
2
active
oldest
votes
For Bootstrap 3, I think these were hardcoded on the body view, but for Bootstrap 4, on this item - /sitecore/system/Settings/Feature/Experience Accelerator/Bootstrap 4/Bootstrap 4 Grid Definition
you should see a section that defines the Placeholder Wrapper tag/class
That precisely answers the question. Thank you!
– Martin Miles
5 hours ago
add a comment |
Firstly, remove this line and reload:
@Html.Sitecore().Placeholder("main")
If the row div is still there, then remove this piece of code:
class="@Html.Sxa().GridPlaceholderClasses("main")"
I'm pretty sure that by doing so you will know exactly where this div row line is coming from.
After that, it's just a matter of troubleshooting your own code and start isolating the possible origins to figure out the exact source of this weird line.
That was the first I did, in order to identify that particular line generates div
– Martin Miles
6 hours ago
And what was the outcome?
– Hugo Santos
5 hours ago
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "664"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsitecore.stackexchange.com%2fquestions%2f16493%2fwhy-does-empty-html-sitecore-placeholdermain-generate-div-class-row%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
For Bootstrap 3, I think these were hardcoded on the body view, but for Bootstrap 4, on this item - /sitecore/system/Settings/Feature/Experience Accelerator/Bootstrap 4/Bootstrap 4 Grid Definition
you should see a section that defines the Placeholder Wrapper tag/class
That precisely answers the question. Thank you!
– Martin Miles
5 hours ago
add a comment |
For Bootstrap 3, I think these were hardcoded on the body view, but for Bootstrap 4, on this item - /sitecore/system/Settings/Feature/Experience Accelerator/Bootstrap 4/Bootstrap 4 Grid Definition
you should see a section that defines the Placeholder Wrapper tag/class
That precisely answers the question. Thank you!
– Martin Miles
5 hours ago
add a comment |
For Bootstrap 3, I think these were hardcoded on the body view, but for Bootstrap 4, on this item - /sitecore/system/Settings/Feature/Experience Accelerator/Bootstrap 4/Bootstrap 4 Grid Definition
you should see a section that defines the Placeholder Wrapper tag/class
For Bootstrap 3, I think these were hardcoded on the body view, but for Bootstrap 4, on this item - /sitecore/system/Settings/Feature/Experience Accelerator/Bootstrap 4/Bootstrap 4 Grid Definition
you should see a section that defines the Placeholder Wrapper tag/class
answered 6 hours ago
Elena ZlatevaElena Zlateva
467311
467311
That precisely answers the question. Thank you!
– Martin Miles
5 hours ago
add a comment |
That precisely answers the question. Thank you!
– Martin Miles
5 hours ago
That precisely answers the question. Thank you!
– Martin Miles
5 hours ago
That precisely answers the question. Thank you!
– Martin Miles
5 hours ago
add a comment |
Firstly, remove this line and reload:
@Html.Sitecore().Placeholder("main")
If the row div is still there, then remove this piece of code:
class="@Html.Sxa().GridPlaceholderClasses("main")"
I'm pretty sure that by doing so you will know exactly where this div row line is coming from.
After that, it's just a matter of troubleshooting your own code and start isolating the possible origins to figure out the exact source of this weird line.
That was the first I did, in order to identify that particular line generates div
– Martin Miles
6 hours ago
And what was the outcome?
– Hugo Santos
5 hours ago
add a comment |
Firstly, remove this line and reload:
@Html.Sitecore().Placeholder("main")
If the row div is still there, then remove this piece of code:
class="@Html.Sxa().GridPlaceholderClasses("main")"
I'm pretty sure that by doing so you will know exactly where this div row line is coming from.
After that, it's just a matter of troubleshooting your own code and start isolating the possible origins to figure out the exact source of this weird line.
That was the first I did, in order to identify that particular line generates div
– Martin Miles
6 hours ago
And what was the outcome?
– Hugo Santos
5 hours ago
add a comment |
Firstly, remove this line and reload:
@Html.Sitecore().Placeholder("main")
If the row div is still there, then remove this piece of code:
class="@Html.Sxa().GridPlaceholderClasses("main")"
I'm pretty sure that by doing so you will know exactly where this div row line is coming from.
After that, it's just a matter of troubleshooting your own code and start isolating the possible origins to figure out the exact source of this weird line.
Firstly, remove this line and reload:
@Html.Sitecore().Placeholder("main")
If the row div is still there, then remove this piece of code:
class="@Html.Sxa().GridPlaceholderClasses("main")"
I'm pretty sure that by doing so you will know exactly where this div row line is coming from.
After that, it's just a matter of troubleshooting your own code and start isolating the possible origins to figure out the exact source of this weird line.
answered 8 hours ago
Hugo SantosHugo Santos
12112
12112
That was the first I did, in order to identify that particular line generates div
– Martin Miles
6 hours ago
And what was the outcome?
– Hugo Santos
5 hours ago
add a comment |
That was the first I did, in order to identify that particular line generates div
– Martin Miles
6 hours ago
And what was the outcome?
– Hugo Santos
5 hours ago
That was the first I did, in order to identify that particular line generates div
– Martin Miles
6 hours ago
That was the first I did, in order to identify that particular line generates div
– Martin Miles
6 hours ago
And what was the outcome?
– Hugo Santos
5 hours ago
And what was the outcome?
– Hugo Santos
5 hours ago
add a comment |
Thanks for contributing an answer to Sitecore Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsitecore.stackexchange.com%2fquestions%2f16493%2fwhy-does-empty-html-sitecore-placeholdermain-generate-div-class-row%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What do you have if you remove the placeholder code line and reload?
– Hugo Santos
8 hours ago