Is there a way to force a new line in rich text?
I have code like below bit it all appears on 1 line?
#C0TITLE#
#C0SHH:mm# | #C0LOC#
Second question.
I'd like a conditional along the lines of:
IF next calendar entry = tomorrow THEN
show calendar entry
ELSE
Show "nothing for tomorrow"
How can I achieve this?
Related
Firstly, I *love* ZWP and have been using it religiously.
With my new Nexus 5, however, I decided to make a new widget to match the current phone instead of my previous setup. I like having my next 3-4 calendar appointments shown in a list with dates and times and the heading, in the #C0SEEE dd - HH:mm# #C0TITLE# format. Some appointments though have longer titles and interfere with other items I have entered into the widget.
I tried using the new Rich Text feature and setting margins to various lengths and setting lines to 1, but a long appointment title still bleeds over into the next portion of my layout.
What am I missing?
Zanthany said:
Firstly, I *love* ZWP and have been using it religiously.
With my new Nexus 5, however, I decided to make a new widget to match the current phone instead of my previous setup. I like having my next 3-4 calendar appointments shown in a list with dates and times and the heading, in the #C0SEEE dd - HH:mm# #C0TITLE# format. Some appointments though have longer titles and interfere with other items I have entered into the widget.
I tried using the new Rich Text feature and setting margins to various lengths and setting lines to 1, but a long appointment title still bleeds over into the next portion of my layout.
What am I missing?
Click to expand...
Click to collapse
You should consider using the [tr]-tags to limit your field to a certain amount of characters. Usage example in your case would be
Code:
#C0SEEE dd - HH:mm# [tr=30]#C0TITLE#[/tr]
This would limit the output of the title to 30 characters and put three dots at the end to indicate the string is longer than what is displayed. You'll have to play around a bit to find the right limit for your particular setup though.
For future references, you can find all the available tags for Rich Text Modules here.
Hope this helps you out
I'm a newbie at this and I don't know how to set this up. I want to make the rich text disappear and reappear with my email counts. Is that possible?
GTRN34 said:
I'm a newbie at this and I don't know how to set this up. I want to make the rich text disappear and reappear with my email counts. Is that possible?
Click to expand...
Click to collapse
yes it is, copy and paste the following code into the "Edit text manually" section. It will display "1 UNREAD" or "2 UNREAD" etc depending on how many new notifications you have. If you dont have any notifications, it wont display anything at all.
$#SUG#>=1?#SUG# UNREAD$
#SUG# is the call method for a Gmail notification count. #SUG# can be swapped out for any other call methods too. such as
#SUSMS# which is SMS unread count etc.
so what the code says is;
Is the Gmail notification count (#SUG#), greater than (>) or equal (=) to 1 (#SUG#, or Gmail count), if the answer returns true (?)
display #SUG# (gmail count) and some text (UNREAD). the dollar signs are simply used to start and complete a method call for every code.
If you would like to show something even when you have no new you can take that code and add the : (or else) to it.
eg.
$#SUG#>=1?#SUG# UNREAD:all read$ = "1 UNREAD" or "all read"
$#SUG#>=1?you got #SUG# mail!:better luck next time$ = "you got 1 mail!" or "better luck next time".
Ya dig?
hope this helps, dont forget to hit the thanks if it does.
Thanks
Thanks for the reply.
:good:
Mv101 said:
yes it is, copy and paste the following code into the "Edit text manually" section. It will display "1 UNREAD" or "2 UNREAD" etc depending on how many new notifications you have. If you dont have any notifications, it wont display anything at all.
$#SUG#>=1?#SUG# UNREAD$
#SUG# is the call method for a Gmail notification count. #SUG# can be swapped out for any other call methods too. such as
#SUSMS# which is SMS unread count etc.
so what the code says is;
Is the Gmail notification count (#SUG#), greater than (>) or equal (=) to 1 (#SUG#, or Gmail count), if the answer returns true (?)
display #SUG# (gmail count) and some text (UNREAD). the dollar signs are simply used to start and complete a method call for every code.
If you would like to show something even when you have no new you can take that code and add the : (or else) to it.
eg.
$#SUG#>=1?#SUG# UNREAD:all read$ = "1 UNREAD" or "all read"
$#SUG#>=1?you got #SUG# mail!:better luck next time$ = "you got 1 mail!" or "better luck next time".
Ya dig?
hope this helps, dont forget to hit the thanks if it does.
Click to expand...
Click to collapse
Mv101 said:
yes it is, copy and paste the following code into the "Edit text manually" section. It will display "1 UNREAD" or "2 UNREAD" etc depending on how many new notifications you have. If you dont have any notifications, it wont display anything at all.
$#SUG#>=1?#SUG# UNREAD$
#SUG# is the call method for a Gmail notification count. #SUG# can be swapped out for any other call methods too. such as
#SUSMS# which is SMS unread count etc.
so what the code says is;
Is the Gmail notification count (#SUG#), greater than (>) or equal (=) to 1 (#SUG#, or Gmail count), if the answer returns true (?)
display #SUG# (gmail count) and some text (UNREAD). the dollar signs are simply used to start and complete a method call for every code.
If you would like to show something even when you have no new you can take that code and add the : (or else) to it.
eg.
$#SUG#>=1?#SUG# UNREAD:all read$ = "1 UNREAD" or "all read"
$#SUG#>=1?you got #SUG# mail!:better luck next time$ = "you got 1 mail!" or "better luck next time".
Ya dig?
hope this helps, dont forget to hit the thanks if it does.
Click to expand...
Click to collapse
hi, this reply of yourself above is quite helpful! thank you for that...I am dealing a little different problem, hope you can help:
I have this zooper gmail count widget... mine is very simple has one email icon and next to the icon has text field where number of new email count displayed. So it looks like this:
email icon image 0
if new email
email icon image 1
how can I make it 01, 02, 03....and when have more than 9, it will show as 10, 11? i meant zero leading from 1 thru 9...
also have any idea say if there's new email, change the email icon to say blue email icon?
jazzespresso said:
hi, this reply of yourself above is quite helpful! thank you for that...I am dealing a little different problem, hope you can help:
I have this zooper gmail count widget... mine is very simple has one email icon and next to the icon has text field where number of new email count displayed. So it looks like this:
email icon image 0
if new email
email icon image 1
how can I make it 01, 02, 03....and when have more than 9, it will show as 10, 11? i meant zero leading from 1 thru 9...
also have any idea say if there's new email, change the email icon to say blue email icon?
Click to expand...
Click to collapse
Glad to help.
As for the 01,02,03 count setup, you can do the following
$#SUG#>=0&&#SUG#<=9?0#SUG#$$#SUG#>=10?#SUG#$
as for the icon colour change, you would do something like the following. (assuming you are using an icon font set like themer icons revised font) otherwise this wont work if its a bitmap obviously
keep this in mind; lets say an email icon is assigned to the letter "k"
$#SUG#=0?[c=#fff0000]k[/c]:k$
So to break it down
$ = start and finish your code
#SUG# = Gmail count variable. if you make a rich text module and type #SUG# by itself, it will show you how many UNREAD emails you have, if none, it will count 0 etc
"=0? " = asks the question, is your gmail count (#SUG#) equal to 0? if so do the following.
[c=#ffff0000] = start the colour markup and make the Following text #ffff0000 which is the colour you want the text to be in hex value, in this case #ffff0000 = red
k = the text you want to show and change colour too, in this an email icon.
[/c] = closes the colour markup
: = or else do this, eg
gmail = 0 unread? k : (otherwise) show blah blah blah
this means if the value returned back from #SUG# is 0, k will show in red, otherwise if the value returned back from #SUG# is anything other than 0, like 1/2 etc, show k. (just remember it will show k in the default colour from the colour picker.
I needed this.
I'm trying to use tasker to alter the font for some items. I have a popup widget that has email, gmail, sms, phone,etc. on it that I want to change font color and become bold when I have a missed call or new message. I've set up tasks and profiles for sms, and gmail so they will change color. I cannot seem to get them to become bold though. They are made as Rich Text if that matters. I can't figure out how to write the parameter where the [c][/c] and take effect together. Can somebody tell me how to write the advanced parameter to get this to work?
Also, I can't seem to figure out the code to use for email or phone. I've tried %COUNTEMAIL, %COUNTMSG, %MISSEDCALL but they don't seem to work. This is the tutorial I used for this: https://seo-michael.co.uk/change-text-colour-in-zooper-widget-with-tasker (sorry can't post a link yet). Can I make this work with the Email App and the Phone?
Thanks!
From what I've read you are trying to display a count rather than the actual text/phonecall details? In which case you would be better off using Zooper's built in variables #SMCALLS# for missed calls and so on. To change the colour of the font in rich text format you can use a conditional like this:
[c=$#SMCALLS#>0?#ffff0000:#ff00ff00$]#SMCALLS#[/c]
This will display missed call count in red when you have missed calls and green when you don't.
Then to change to bold for missed calls as well you can wrap the above in a conditional like this:
HTML:
$#SMCALLS#>0?[b]$[c=$#SMCALLS#>0?#ffff0000:#ff00ff00$]#SMCALLS#[/c]$#SMCALLS#>0?[/b]$
Hope this helps.
ps Sorry about the HTML tags but I don't know how to stop it from rendering the bold tags in the code instead of displaying them
Thanks. Are there built in variables for gmail, email, and sms? I'm trying that code but it doesn't seem to do anything on my phone...
Yes there are functions for sms , gmail etc. You can find them under the system heading when you enter your text.
The code I wrote should work fine. Are you entering it in the advanced parameters screen of the manual text edit screen?
I used the manual screen when I wrote it. When you enter it does nothing happen at all? Or only part of what you want?
Torgadden said:
Yes there are functions for sms , gmail etc. You can find them under the system heading when you enter your text.
The code I wrote should work fine. Are you entering it in the advanced parameters screen of the manual text edit screen?
I used the manual screen when I wrote it. When you enter it does nothing happen at all? Or only part of what you want?
Click to expand...
Click to collapse
I'm putting it into the advanced parameters because the manual text area is what is labeling the shortcut I have. It doesn't nothing when I enter it. I've written it, copy and pasted from the site, and still nothing. I can modify it and get the color I want to change but it will not turn bold.
I think that it needs to be written in the text area because the bold tags will need to go round your text in the same way they do if you use the bold function when writing a post here.
Torgadden said:
I think that it needs to be written in the text area because the bold tags will need to go round your text in the same way they do if you use the bold function when writing a post here.
Click to expand...
Click to collapse
Hmm ok. How do I write the paramater and still keep the text I have then? So for example, I have one line that says "gmail". Clicking the word opens gmail and when I have a new email it changes from white to green based on the #COUNTGMAIL task I have in Tasker. How do I write in the code in the manual field to keep the "gmail" and still make it change? I'll be playing with this shortly when I get a chance.
You can mix text in with your functions so if you just want the word Gmail displayed and for that word to change colour and bold when you have unread mail you would lay it out like this:
HTML:
$#SUG#>0?[b]$[c=$#SUG#>0?#ff00ff00:#ffffffff$]Gmail[/c]$#SUG#>0?[/b]$
So going through it one step at a time, the first conditional (between $ $) if unread gmail count is greater than 0 then write the open bold tag.
Then open the colour tag, if unread gmail count is greater than 0 then set font colour to green, otherwise colour is set to white.
Next the text you want to display is written, "Gmail" in this case but you could add other zooper variables or text if you needed.
Close the colour tag.
Finally the last conditional writes the close bold tag in the same way as for the first conditional.
Zooper will then render the text code as you needed it.
Hope this helps
Torgadden said:
You can mix text in with your functions so if you just want the word Gmail displayed and for that word to change colour and bold when you have unread mail you would lay it out like this:
HTML:
$#SUG#>0?[b]$[c=$#SUG#>0?#ff00ff00:#ffffffff$]Gmail[/c]$#SUG#>0?[/b]$
So going through it one step at a time, the first conditional (between $ $) if unread gmail count is greater than 0 then write the open bold tag.
Then open the colour tag, if unread gmail count is greater than 0 then set font colour to green, otherwise colour is set to white.
Next the text you want to display is written, "Gmail" in this case but you could add other zooper variables or text if you needed.
Close the colour tag.
Finally the last conditional writes the close bold tag in the same way as for the first conditional.
Zooper will then render the text code as you needed it.
Hope this helps
Click to expand...
Click to collapse
Thank you. That code works perfectly. If only I could get the zooper widget to update quicker.
So my next question is, do you have the parameter code for regular email? I know the #SUG# is gmail but I don't have the code for email, or phone, or sms. I think those are the only ones I need to do this. Although I would like to have the "music" line change color when poweramp is running....
If you go to edit text you will see the list of available fields. SMS counts, etc are under system. Looking at them I could have sworn that there was a regular email count but I can't see it now, you should be able to capture that in Tasked and pass it to zooper as a variable though.
As for the media, use Media Utilities to get the player state. It gives you a whole set of variables which will let you work with media states in Zooper
Hey, all. First of all, love Zooper and think it's amazing. I'm just starting off with advanced fields and conditionals and have had mixed results. I've searched around for some answers and experimented on my own, but have not been able to produce a successful result with one of my rich text fields.
Essentially what I'm doing is a if then statement for colors for SMS and e-mails (as demonstrated in many great tutorials) and have had success with one, but not another.
My successful conditional reads: $#SUSMS#<1? : #SUSMS#$ I.E. if the unread SMS count is less then 1, display an emoji, if greater, display the unread SMS count.
However, when I extend this to my Gmail formula I run into a problem. Because my I want my unread Gmail to read an accurate count across my default inbox (primary, promotions, updates) I use the math conditional $(#SUG0Primary#+#SUG0Updates#+#SUG0Promotions#)$ which works wonderfully by itself, for example (3+5+1) = 9 and the output reads 9.
But when I try to throw that into a similar statement as above, like $ $(#SUG0Primary#+#SUG0Updates#+#SUG0Promotions#)$<1? : (#SUG0Primary#+#SUG0Updates#+#SUG0Promotions#)$ $ the output displays the math formula twice (3+5+1) (3+5+1), rather than the the desired result of 9 or an emoji.
Basically, I'm trying to find how accomplish the desired effect of my SMS conditional, but the addition of this math conditional is giving me problems and I cannot find the correct solution. Any tips or advice?
You don't need the extra $s around the math expressions because it's already surrounded by $s since its embedded in a conditional statement:
This should work:
$(#SUG0Primary#+#SUG0Updates#+#SUG0Promotions#)<1? emoji : (#SUG0Primary#+#SUG0Updates#+#SUG0Promotions#)$
I'd like to display my calendar events in the following format:
Date Day BeginningTime - EndTime | Event title, Event location
with conditional formating that if the event is an all-day event the BeginningTime and EndTime shouldn't be displayed.
So far the code i use is:
Code:
#C0SEEE# $#C0D#<1?#C0SHH:MM#-#C0ehh:MM# $| #C0TITLE# #C0LOC#
The problem is that if i use colon in the code the result is displayed as "#C0SHH" and "C0EHH" instead of actual beginning and ending time. Also, since i want to display multiple events i copy the code to the next line and make a paragraph (enter) between the two code lines. In the "Edit text manually" preview the code is displayed as it should be (each event in its own line), while on the widget itself all events are in the same line. So here are my questions:
1. How to display column between hour and minute values when using conditional formatting?
2. How to display each event in its own line?
3. What's the code to display event date (number value, ie. 26th)?
1. You can escape the colon character with \ for use inside conditionals. Thus, this would work: $#C0D#<1?#C0SHH\:mm#-#C0EHH\:mm# $
2. Use the "Rich Text" module instead of the "Text" module. Rich Text provides support for multiline elements. It also provides support for other things, which is necessary for...
3. [no]#...d#[/no]. So for event 0: [no]#C0Sd#[/no]
4. Watch your capitalization. In free dates, MM is not the same as mm, likewise for HH and hh, and so on.