| |
| | |

CodersClub

 Forgot password?
 Register
Search
View: 6966|Reply: 6
Collapse the left

How to list all the article Categories and title in portal?

[Copy link]

 China

Post time: 2013-12-26 14:34
| Show all posts |Read mode
本帖最后由 leon 于 2013-12-26 15:41 编辑

Example:

· Category_1
· Subcategory_1_1
   · Article_1_1_1
   · Article_1_1_2
· Subcategory_2
   · Article_1_2_1
   · Article_1_2_2
· Category_2
· Subcategory_2_1
   · Article_2_1_1
   · Article_2_1_2
· Subcategory_2_2
   · Article_2_2_1
   · Article_2_2_2

I would like to use it as template, so its code format should be like following:
  1. <!--{if $cat[others]}-->
  2. <div class="bm">
  3.         <div class="bm_h cl">
  4.                 <h2>{lang category_related}</h2>
  5.         </div>
  6.         <div class="bm_c">
  7.                 <ul class="xl xl2 cl">
  8.                         <!--{loop $cat[others] $value}-->
  9.                         <li><a href="{echo getportalcategoryurl($value[catid])}">$value[catname]</a></li>
  10.                         <!--{/loop}-->
  11.                 </ul>
  12.         </div>
  13. </div>
  14. <!--{/if}-->

  15. <!--{if $cat[subs]}-->
  16. <div class="bm">
  17.         <div class="bm_h cl">
  18.                 <h2>{lang sub_category}</h2>
  19.         </div>
  20.         <div class="bm_c">
  21.                 <ul class="xl xl2 cl">
  22.                 <!--{loop $cat[subs] $value}-->
  23.                         <li><a href="{echo getportalcategoryurl($value[catid])}">$value[catname]</a></li>
  24.                 <!--{/loop}-->
  25.                 </ul>
  26.         </div>
  27. </div>
  28. <!--{/if}-->
Copy the Code
Thx for help!

 Russia

Post time: 2013-12-27 07:17
| Show all posts
First of all you have to discover the category array structure!
Use something like this:
  1. <pre>
  2. {php}
  3. print_r($cat);
  4. {/php}
  5. <pre>
Copy the Code

 China

 Author| Post time: 2013-12-30 08:52
| Show all posts
I checked lots of posts by google and discuz official plugin site, but I don't found any example to refer. It seems like I have to write it by myself. Hmmm..

 China

 Author| Post time: 2014-01-10 06:40
| Show all posts
vot 2013-12-27 08:17
First of all you have to discover the category array structure!
Use something like this:

I failed in this subject, it will cost too long time for me to understand the mechanism of Discuz function.
so I just use a static html/CSS/Javascript menu tree to show all the list, not perfect, but at least it works and meet my requirement.



Dude, Multi-Language code {lang xxxxx} won't work in Article, whether have a solution to modify it?

This post contains more resources

You have to Login for download or view attachment(s). No Account? Register

x

 Russia

Post time: 2014-01-10 07:22
| Show all posts
What the URL was under your screenshot?
(you may remove the domain from URL)
How to simulate the problem here?

 China

 Author| Post time: 2014-01-10 10:31
| Show all posts
vot 2014-1-10 08:22
What the URL was under your screenshot?
(you may remove the domain from URL)
How to simulate the pro ...


It's an article, I write the {lang xxx} code, it is not support default, whether can modify it to support?

This post contains more resources

You have to Login for download or view attachment(s). No Account? Register

x

 Russia

Post time: 2014-01-10 14:32
| Show all posts
I think it is not so good idea to translate language variables inside the content.
This will cause many problems:
1) It is not clean when to translate or when to NOT translate the language tags.
2) It is very hard to maintain the language files containing the language tags for all the content (articles, threads, products, polls, etc)

Most of developers supports just another idea for a multilingual content:
just create a separated content for every language supported.
But this idea is very hard to implement in Discuz...
You have to log in before you can reply Login | Register

Points Rules

Archive|Mobile|Dark room|CodersClub

Top.Mail.Ru
Top.Mail.Ru

2024-05-04 00:26 GMT+3 , Processed in 0.067388 sec., 8 queries .

Powered by Discuz! X3.4 Release 20230520

© 2001-2024 Discuz! Team.

MultiLingual version, Rev. 4301, © codersclub.org

Quick Reply To Top Return to the list