How to create custom "topicBlock" for different HTML content

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
Hello guys,

I would like to know if it is possible by any chance to create a new topic block file. I'v tried it before, but with no luck. The complete platform just gives me a system error. The reason why i am asking this, i want to separate different HTML blocks into different topic blocks. That way, i can i style different topic blocks better.

Thanks in advance.

Warm regards,
Galanthus
6 years ago
I have a simple solution for you, please have a look.

1) Open TopicBlock.cshtml view, looking for following lines of code

<div class="topic-block" id="[email protected]">


and that one

<div class="topic-block">


replace them to

<div class="topic-block [email protected]" id="[email protected]">


and

<div class="topic-block [email protected]">


2) In your stylesheet file, you can style each type of topic block based on the rendered CSS class in above view.
For example, the "Search engine friendly page name" for HomePageText topic is "welcome-to-our-store".
So that, its CSS class will be "topic-block--welcome-to-our-store".
And then, you can set styles for that CSS class like:

.topic-block--welcome-to-our-store {
    background-color: blue;
}


The same method will be applied for other topic blocks.

Hope that help :)
6 years ago
ima9ines wrote:
I have a simple solution for you, please have a look.

1) Open TopicBlock.cshtml view, looking for following lines of code

<div class="topic-block" id="[email protected]">


and that one

<div class="topic-block">


replace them to

<div class="topic-block [email protected]" id="[email protected]">


and

<div class="topic-block [email protected]">


2) In your stylesheet file, you can style each type of topic block based on the rendered CSS class in above view.
For example, the "Search engine friendly page name" for HomePageText topic is "welcome-to-our-store".
So that, its CSS class will be "topic-block--welcome-to-our-store".
And then, you can set styles for that CSS class like:

.topic-block--welcome-to-our-store {
    background-color: blue;
}


The same method will be applied for other topic blocks.

Hope that help :)


Very nice, thanks. but what if i want to change the HTML structure elements?
6 years ago
As I saw in the TopicBlock view, it is very basic markup, like

<div class="topic-block">
    <div class="topic-block-title"><h2>...</h2></div>
    <div class="topic-block-body">...</div>
</div>

Other HTML markup, you can define with TinyMCE inside admin page, so you can free to layout and style it.

BTW, we are developing a plugin to supported change topic block template like the topic details template.
If you are interesting on it, we will provide you when it finished.

Hope that help :)
6 years ago
ima9ines wrote:
As I saw in the TopicBlock view, it is very basic markup, like

<div class="topic-block">
    <div class="topic-block-title"><h2>...</h2></div>
    <div class="topic-block-body">...</div>
</div>

Other HTML markup, you can define with TinyMCE inside admin page, so you can free to layout and style it.

BTW, we are developing a plugin to supported change topic block template like the topic details template.
If you are interesting on it, we will provide you when it finished.

Hope that help :)


I am interested for sure! Can you let me know? How long will it take untill its finished?
6 years ago
Galanthus wrote:
As I saw in the TopicBlock view, it is very basic markup, like

<div class="topic-block">
    <div class="topic-block-title"><h2>...</h2></div>
    <div class="topic-block-body">...</div>
</div>

Other HTML markup, you can define with TinyMCE inside admin page, so you can free to layout and style it.

BTW, we are developing a plugin to supported change topic block template like the topic details template.
If you are interesting on it, we will provide you when it finished.

Hope that help :)

I am interested for sure! Can you let me know? How long will it take untill its finished?


Hi, we are going to release that kind of plugin.
Please have a look at following forum post - https://www.nopcommerce.com/boards/t/49863/the-upcoming-plugin-enhanced-topic.aspx

Hope that help :)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.