Page 1 of 1

Request: Mandatory Author's category

Posted: Fri Aug 30, 2019 2:43 am
by SadlyMistaken
Hello everybody!!

My authors (users that only want to focus on write write write....) are lazy. They don't want to choose a category, they only want to write and "maybe" to choose tags... :D :D :D

nahh... that is a joke... :lol: they always choose a category hahaha

I would like to have an url as categories url... but named with the alias name of the author for example, and then to list the short link cards of their articles.. o maybe i want something like:
http://www.mywebsite.dot/author/author_name/ and then, magic!

The only way i can imagine and manage to do this in that moment is:
- I created a category with the name of the author...
- I created a navigator link in my sidebar with the categories urls...
- I asked to every author to choose their respective category in their articles...

so... my authors are Categories... Anne..is able to see her links cards in mysite.com/category/anne
:? But her articles haven't own category... "Recipes" "Technician" etc...so... TAGS... ( :? )

BUT! maybe it would be easier if in the users table, the administrator could see 2 things.
- A sticky square with label "Mandatory Category" (YES/NO... boolean...whatever)
- A input text to write THAT new category or.. a dropdown to choose the category (better option in my opinion)

and the result of this could be that they would see an inactive dropdown in the category section when they are writting their content.. because It would be the correct one, always... and then only write tags... I don't know..

but... i rather prefer the MAGIC option, muchly

:P hahahaha... Ok, what do you think? tell me please, if that is an absurd idea don't hesitate to tell me too....

Thanks!!! (And apologize my bad english... sorry... i only want to be read for more people in the forum :D) Bye!

Re: Request: Mandatory Author's category

Posted: Sat Aug 31, 2019 2:59 pm
by SadlyMistaken
Sorry I just read that abs301216 asked for the same in 2019/May post:
viewtopic.php?f=6&t=1471

:D

Re: Request: Mandatory Author's category

Posted: Sun Sep 01, 2019 12:03 am
by Edi
You can use the following to get the username, nickname etc.:

$page->username()

and

$page->user('username')
$page->user('nickname')
$page->user('firstName')
$page->user('lastName')

Together with if conditions in the template home.php you can create author pages for example.

Re: Request: Mandatory Author's category

Posted: Fri Aug 28, 2020 10:41 am
by shoovi
Hi, I am working on some customization of the page's theme and I can not get the first name of the logged user.

So if I am a logged user I'd like to see my "firstName" displayed on the screen.
I tried this $login->user('firstName'); but it does not work.


How to get the FirstName of the logged user?

Re: Request: Mandatory Author's category

Posted: Fri Aug 28, 2020 5:36 pm
by Edi
Diego, the developer, answered me, that you have to to create the $login in the frontend to get the username of the logged in user:

Code: Select all

$login = new Login();

Re: Request: Mandatory Author's category

Posted: Fri Aug 28, 2020 7:29 pm
by shoovi
Thanks, Edi,
Yes, I do it. I create a new $login object and then I try this: $login->user('firstName');
but I get nothing.

;(

Re: Request: Mandatory Author's category

Posted: Fri Aug 28, 2020 11:02 pm
by shoovi
So my point is that I want to get the logged user first name, not a user name.

The first name is the field that can be optionally filled in the Admin panel, and I need to be able to access that value while I am logged in.

Re: Request: Mandatory Author's category

Posted: Sat Aug 29, 2020 11:31 am
by Edi
You can post feature requests on our GitHub tracker:

https://github.com/bludit/bludit/issues

Re: Request: Mandatory Author's category

Posted: Sat Aug 29, 2020 12:53 pm
by shoovi
Ok, I've made it!

Code: Select all

	$login = new Login();
	$myLoggedUser = $login->username();
	
		$myLoggedUserObject = new User($myLoggedUser);
		$myLoggedUserFirstName = $myLoggedUserObject->firstName($myLoggedUser);

Re: Request: Mandatory Author's category

Posted: Sat Aug 29, 2020 1:02 pm
by Edi
Great!