| 
	|||||||
![]()  | 
            
        
    
| 
             | 
        Thread Tools | Search this Thread | 
| 
			
			 | 
		#1 | 
| 
			
			
			
			 Addict 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 262 
				Karma: 110864 
				Join Date: Mar 2013 
				Location: Bordeaux, France 
				
				
				Device: Kobo Glo, Aura HD, kindle paperwhite 
				
				
				 | 
	
	
	
		
		
			
			 
				
				[solved] template: if one of the tag is sthg... maybe contains or in_list functions
			 
			
			
			Hi all, 
		
	
		
		
		
		
		
		
		
		
		
		
		
			Post Summary Can someone provide a way to display a word in the filename depending on the presence of the tags? Something like : If one of the tags is "xxx" then add "yyy" if not "zzz" Detailed post I am testing the way my books are rendered on my reader. I need the template to add a special keyword in the filename (actually an extension prefix) when sending to device, depending on the tags I gave: If one the tags is "kepub" display ".kepub" if not display "" I didn't succeed with these syntaxes: 
 Can someone provide examples for those functions using the {tags} as value: 
 Resources: 
 Thank you for your help, Regards François Last edited by fxp33; 07-19-2014 at 06:20 AM. Reason: marked solved  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#2 | 
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905 
				Karma: 47303824 
				Join Date: Jul 2011 
				Location: Sydney, Australia 
				
				
				Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			The following seems to work: 
		
	
		
		
		
		
		
		
		
		
		
		
		
			Code: 
	{tags:'in_list($, ",", "kepub", ".kepub", "")'}
But, I have to ask, why? You can store kepubs in calibre. And if you send a book to a Kobo device using the KoboTouch driver, it can send either an epub or kepub. If you send a kepub, the driver names the file on the device as needed for it to be treated as a kepub. And if you have both formats for a book, you can set which the driver will send. Last edited by davidfor; 07-16-2014 at 09:49 AM.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| Advert | |
| 
         | 
    
| 
			
			 | 
		#3 | 
| 
			
			
			
			 Addict 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 262 
				Karma: 110864 
				Join Date: Mar 2013 
				Location: Bordeaux, France 
				
				
				Device: Kobo Glo, Aura HD, kindle paperwhite 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Hi Davidfor, 
		
	
		
		
		
		
		
		
		
		
		
		
	
	As usual, your are a savior... A double savior :-) I would never have guessed about the dollar argument in the function. Might be a good idea to insert a few examples in the manual. I will try to collect a few things and post them in the recipe. For the driver use, i guess I didn't find the right way t send (without correcting) epub or kepub... I might look it up in the plugin forum. Thank you again for your answer François  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#4 | ||
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905 
				Karma: 47303824 
				Join Date: Jul 2011 
				Location: Sydney, Australia 
				
				
				Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 Quote: 
	
  | 
||
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#5 | 
| 
			
			
			
			 Addict 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 262 
				Karma: 110864 
				Join Date: Mar 2013 
				Location: Bordeaux, France 
				
				
				Device: Kobo Glo, Aura HD, kindle paperwhite 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Hi, DavidFor,  
		
	
		
		
		
		
		
		
		
		
		
		
	
	Sorry for the delay, I was traveling for work. Thank you very much for the details added in your explanation and for the link. I might plunge into the manual this afternoon to understand fully how it works. And for Calibre of course, this is a few hours more testing ahead ![]() Regards François  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| Advert | |
| 
         | 
    
![]()  | 
            
        
    
            
  | 
    
			 
			Similar Threads
		 | 
	||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| Sorting tag values in tag browser | mcam | Library Management | 15 | 08-25-2013 06:50 AM | 
| Send tag to device only if tag has more than 1 book? | eosrose | Calibre | 0 | 01-29-2013 08:46 PM | 
| Making references to other fields in template functions | Ruskie_it | Library Management | 10 | 12-21-2011 11:53 PM | 
| Does anyone use "general program mode" template functions? | chaley | Library Management | 0 | 08-16-2011 12:54 PM | 
| Adding an Owner tag to tag list? | Fangles | Library Management | 1 | 02-25-2011 03:32 AM |