We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

A few questions, looking for direction

How Do I?

mhallaba's avatar
mhallaba
32 posts
9 years ago
mhallaba's avatar mhallaba

Hi,

Looking for direction on a few things.

1) Is it possible to order channel entries with a specific algorithm? For example i want to do something similar to Reddit where it ranks my posts by number of “likes” how old the post is, number of comments, etc.

2) What’s the most efficient way to override the CSS for forms and User interface stuff. For example, pagination always seems to use its own CSS from the user CP and I’d rather just write my own CSS than have to edit all that stuff. Also, forms will by default be formatted a certain way if you use channel form tags.

3) What’s the best way to make URL_title unique? I want the permalinks to be somewhat recognizable if possible in the URL box, not just a bunch of numbers. Right now I have an issue that if two users try to post something with the same title it will give an error. Perhaps it can be a combination of their username and the post title?

Thanks

       
Pedro Guimaraes's avatar
Pedro Guimaraes
170 posts
9 years ago
Pedro Guimaraes's avatar Pedro Guimaraes
1) Is it possible to order channel entries with a specific algorithm? For example i want to do something similar to Reddit where it ranks my posts by number of “likes” how old the post is, number of comments, etc.

Very. You can write an add on to order it whichever way you wish.

2) What’s the most efficient way to override the CSS for forms and User interface stuff. For example, pagination always seems to use its own CSS from the user CP and I’d rather just write my own CSS than have to edit all that stuff. Also, forms will by default be formatted a certain way if you use channel form tags.

I’m not entirely clear on what you’re trying to accomplish. If you mean styling the cpanel, then you can write a cpanel theme. If you mean frontend stuff, you can enclose a form in a div with an id and easily style the elements.

3) What’s the best way to make URL_title unique? I want the permalinks to be somewhat recognizable if possible in the URL box, not just a bunch of numbers. Right now I have an issue that if two users try to post something with the same title it will give an error. Perhaps it can be a combination of their username and the post title?

I’ve never seen a url_title with a bunch of numbers. When you type in a title it creates a url_title based on the title. Ideally your website should not have any content with duplicate titles so if you want to write say “Spring News”, you’re better off writing “Spring News 2016” and then the URL title would automatically be spring-news-2016

Hope this helps.

       
mhallaba's avatar
mhallaba
32 posts
9 years ago
mhallaba's avatar mhallaba

1) Thanks, will look into it.

2) Channel forms… they style a certain way unless I manually go in and delete the CSS file that forms use in EE. It seems to override my own CSS if I just do a class=”x” and style X in my CSS for the page the form is on.

3) My users are the ones creating the channel posts, so they could very easily create 2 posts with the same name. I need to be able to append something to the url title to differentiate even if the title of the post is the same.

       
Pedro Guimaraes's avatar
Pedro Guimaraes
170 posts
9 years ago
Pedro Guimaraes's avatar Pedro Guimaraes

Try enclosing the channel form in a div like:

<div id="custom-channel-form">
{exp:channel:form channel="news"}
  <input name="title" type="text">
  <input type="submit" value="Submit">
{/exp:channel:form}
</div>

And then styling it like:

#custom-channel-form input[type="text"] { background-color:#000 !important; }

That works for me.

       
Ingmar Greil's avatar
Ingmar Greil
29,243 posts
9 years ago
Ingmar Greil's avatar Ingmar Greil
1) Thanks, will look into it.

Take a look at Low Reorder.

       
mhallaba's avatar
mhallaba
32 posts
9 years ago
mhallaba's avatar mhallaba
1) Thanks, will look into it.
Take a look at Low Reorder.

Any demo for this? I don’t want to order them manually. I want to program it so that it keeps resorting them as new posts are made according to a set of rules.

       
Rob Allen's avatar
Rob Allen
2,950 posts
9 years ago
Rob Allen's avatar Rob Allen
Any demo for this? I don’t want to order them manually. I want to program it so that it keeps resorting them as new posts are made according to a set of rules.

Low Reorder does reply on manual adjustments so probably wouldn’t work for you in this case.

What specific “rules” do you want to order by?

       
mhallaba's avatar
mhallaba
32 posts
9 years ago
mhallaba's avatar mhallaba
Any demo for this? I don’t want to order them manually. I want to program it so that it keeps resorting them as new posts are made according to a set of rules.
Low Reorder does reply on manual adjustments so probably wouldn’t work for you in this case. What specific “rules” do you want to order by?

I want to give each post a score based on a few variables. Average rating, number of comments, age in days, etc.

But I want to be free to change that algorithm and have it adjust. Obviously it will take some tweaking to get the right algorithm so the solution needs to be flexible.

       
Rob Allen's avatar
Rob Allen
2,950 posts
9 years ago
Rob Allen's avatar Rob Allen

I reckon that sort of complexity would require a custom addon to create the display order. Something that takes all your variable values, does a calculation, then gives a list of entry ID’s in the order you want them. The ID’s can then be used in your Channel entries using the fixed_order=”3|7|1” parameter - https://docs.expressionengine.com/latest/channel/channel_entries.html#id40

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.